* Some javascript improvements

* Fixed little issues into the admin app

see #204
This commit is contained in:
Antoine Nguyen
2012-04-03 12:54:57 +02:00
parent 483ff2e1d6
commit 975b40e7d8
10 changed files with 35 additions and 21 deletions
+6 -2
View File
@@ -28,7 +28,9 @@ function newaccount_cb() {
function editaccount_cb() {
accountform_init();
$('#submit').click(function(e) {
simple_ajax_form_post(e, editaccount_cb);
simple_ajax_form_post(e, {
error_cb: editaccount_cb
});
});
}
@@ -39,7 +41,9 @@ function dlistform_cb() {
});
$("#id_recipients").dynamic_input();
$(".submit").one('click', function(e) {
simple_ajax_form_post(e, dlistform_cb);
simple_ajax_form_post(e, {
error_cb: dlistform_cb
});
});
}
+3 -1
View File
@@ -10,7 +10,7 @@
show: function(e) {
e.preventDefault();
this.box = this.buildbox();
this.box.modal();
this.box.on('hidden', $.proxy(this.hidden_callback, this));
@@ -85,6 +85,8 @@
}
if (data.status == "ok") {
window.location.reload();
} else {
$("body").notify("error", data.respmsg);
}
}
});
+2 -2
View File
@@ -151,10 +151,10 @@ History.prototype = {
},
getparam: function(name) {
if (!this.params.has(name)) {
if (this.params[name] === undefined) {
return "";
}
return this.params.get(name);
return this.params[name];
},
baseurl: function(value, noreset) {
+9 -2
View File
@@ -25,8 +25,11 @@
},
listen: function() {
$(document).on("click", "tbody>tr",
$.proxy(this.toggle_select, this));
$(document)
.off("click", "tbody>tr")
.on("click", "tbody>tr",
$.proxy(this.toggle_select, this));
$(document).on("keydown", "body", $.proxy(this.keydown, this));
$(document).on("keyup", "body", $.proxy(this.keyup, this));
},
@@ -66,6 +69,10 @@
this._toggle_select($tr);
},
is_selected: function($row) {
return $row.hasClass(this.options.tr_selected_class);
},
current_selection: function() {
return $("tr[class*=" + this.options.tr_selected_class + "]");
},