mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-03 11:30:15 +01:00
refactor js of new todo form: share projects and contexts array over all edit forms
this will hopefully decrease memory usage and also the get-form ajax should result in less data to be retrieved
This commit is contained in:
parent
ae30869f85
commit
f0e5c3841d
3 changed files with 6 additions and 3 deletions
|
|
@ -70,6 +70,7 @@
|
|||
<script type="text/javascript" charset="utf-8">
|
||||
|
||||
var contextNames = <%= context_names_for_autocomplete %>;
|
||||
var projectNames = <%= project_names_for_autocomplete %>
|
||||
|
||||
function askIfNewContextProvided() {
|
||||
var givenContextName = $('todo_context_name').value;
|
||||
|
|
@ -80,7 +81,7 @@
|
|||
return confirm('New context "' + givenContextName + '" will be also created. Are you sure?');
|
||||
}
|
||||
|
||||
var projectAutoCompleter = new Autocompleter.Local('todo_project_name', 'project_list', <%= project_names_for_autocomplete %>, {choices:100,autoSelect:false});
|
||||
var projectAutoCompleter = new Autocompleter.Local('todo_project_name', 'project_list', projectNames, {choices:100,autoSelect:false});
|
||||
|
||||
function selectDefaultContext() {
|
||||
todoContextNameElement = $('todo_context_name');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue