migrate creating a new context and refactor some project js to share with context js

This commit is contained in:
Reinier Balt 2010-10-22 20:46:06 +02:00
parent 8f5efff8da
commit 15fdb1e572
14 changed files with 178 additions and 101 deletions

View file

@ -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',