mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-03 14:31:47 +01:00
Fixed a minor issue introduced by last changeset where default projects for contexts were not always behaving properly and resulted in javascript errors.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@582 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
565a8a83be
commit
c3ccae9f9e
1 changed files with 4 additions and 4 deletions
|
|
@ -59,12 +59,11 @@ Event.observe($('todo_project_name'), "blur", selectDefaultContext.bind($('todo_
|
|||
|
||||
<script type="text/javascript">
|
||||
var contextAutoCompleter;
|
||||
function intializeNamesForAutoComplete(contextNamesForAutoComplete) {
|
||||
function initializeNamesForAutoComplete(contextNamesForAutoComplete) {
|
||||
if (contextNamesForAutoComplete.length == 0 || contextNamesForAutoComplete[0].length == 0) {
|
||||
return;
|
||||
}
|
||||
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));
|
||||
|
|
@ -76,10 +75,11 @@ function updateContextNamesForAutoComplete(contextNamesForAutoComplete) {
|
|||
}
|
||||
else
|
||||
{
|
||||
intializeNamesForAutoComplete(contextNamesForAutoComplete)
|
||||
initializeNamesForAutoComplete(contextNamesForAutoComplete)
|
||||
}
|
||||
}
|
||||
intializeNamesForAutoComplete(<%= context_names_for_autocomplete %>);
|
||||
initializeNamesForAutoComplete(<%= context_names_for_autocomplete %>);
|
||||
$('todo_context_name').projectDefaultContextsMap = eval('(' + <%= @default_project_context_name_map %> + ')');
|
||||
</script>
|
||||
|
||||
<label for="tag_list">Tags (separate with commas)</label>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue