migrate deleting a note from notes page to jqeury

This commit is contained in:
Reinier Balt 2010-11-11 22:14:14 +01:00
parent 7b3c07a754
commit 145c9105dd
13 changed files with 145 additions and 84 deletions

View file

@ -104,6 +104,19 @@ var IntegrationsPage = {
}
}
var NotesPage = {
setup_behavior: function() {
$('a.delete_note_button').live('click', function(evt){
evt.preventDefault();
if(confirm("Are you sure that you want to "+this.title+"?")){
$(this).parents('.project').block({message: null});
params = {_method: 'delete'};
$.post(this.href, params, null, 'script');
}
});
}
}
$.fn.clearForm = function() {
return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase();
@ -740,6 +753,7 @@ $(document).ready(function() {
});
IntegrationsPage.setup_behavior();
NotesPage.setup_behavior();
/* Gets called from some AJAX callbacks, too */
enable_rich_interaction();