mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-01 14:58:50 +01:00
Remove default context of "Create a new context" when no contexts exist. i.e. a new user. Closes #511.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@555 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
29d9403324
commit
77bed1e80b
2 changed files with 9 additions and 6 deletions
|
|
@ -192,7 +192,7 @@ module TodosHelper
|
|||
end
|
||||
|
||||
def context_names_for_autocomplete
|
||||
return array_or_string_for_javascript(['Create a new context']) if @contexts.empty?
|
||||
#return array_or_string_for_javascript(['Create a new context']) if @contexts.empty?
|
||||
array_or_string_for_javascript( @contexts.collect{|c| escape_javascript(c.name) } )
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -56,11 +56,14 @@ Event.observe($('todo_project_name'), "blur", selectDefaultContext.bind($('todo_
|
|||
<div class="page_name_auto_complete" id="context_list" style="display:none"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
contextAutoCompleter = new Autocompleter.Local('todo_context_name', 'context_list', <%= context_names_for_autocomplete %>, {choices:100,autoSelect:false});
|
||||
$('todo_context_name').projectDefaultContextsMap = eval('(' + <%= @default_project_context_name_map %> + ')');
|
||||
Event.observe($('todo_context_name'), "focus", function(){ $('todo_context_name').editedByTracksUser = true; });
|
||||
Event.observe($('todo_context_name'), "focus", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
Event.observe($('todo_context_name'), "click", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
contextNamesForAutoComplete = <%= context_names_for_autocomplete %>;
|
||||
if (contextNamesForAutoComplete.length > 1 || contextNamesForAutoComplete[0].length > 0)
|
||||
contextAutoCompleter = new Autocompleter.Local('todo_context_name', 'context_list', contextNamesForAutoComplete, {choices:100,autoSelect:false});
|
||||
$('todo_context_name').projectDefaultContextsMap = eval('(' + <%= @default_project_context_name_map %> + ')');
|
||||
Event.observe($('todo_context_name'), "focus", function(){ $('todo_context_name').editedByTracksUser = true; });
|
||||
Event.observe($('todo_context_name'), "focus", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
Event.observe($('todo_context_name'), "click", contextAutoCompleter.activate.bind(contextAutoCompleter));
|
||||
}
|
||||
</script>
|
||||
|
||||
<label for="tag_list">Tags (separate with commas)</label>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue