mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-19 23:46:10 +01:00
migrate creating a new context and refactor some project js to share with context js
This commit is contained in:
parent
8f5efff8da
commit
15fdb1e572
14 changed files with 178 additions and 101 deletions
|
|
@ -41,6 +41,13 @@ var TracksForm = {
|
|||
},
|
||||
set_tag_list: function (name) {
|
||||
$('input#tag_list').val(name);
|
||||
},
|
||||
show_errors: function (html) {
|
||||
$('div#error_status').html(html);
|
||||
$('div#error_status').show();
|
||||
},
|
||||
hide_errors: function () {
|
||||
$('div#error_status').hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -617,6 +624,17 @@ $(document).ready(function() {
|
|||
return false;
|
||||
});
|
||||
|
||||
$("form#context-form button.positive").live('click', function (ev) {
|
||||
$('form.#context-form').ajaxSubmit({
|
||||
type: 'POST',
|
||||
async: true,
|
||||
buttons_dom_elem: $(this),
|
||||
beforeSend: function() {this.buttons_dom_elem.block({message: null});},
|
||||
complete: function() {this.buttons_dom_elem.unblock();}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#toggle_project_new').click(function(evt){
|
||||
TracksForm.toggle('toggle_project_new', 'project_new', 'project-form',
|
||||
'« Hide form', 'Hide new project form',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue