Prevent a double loading.

fix #669
This commit is contained in:
Antoine Nguyen
2015-01-07 09:47:53 +01:00
parent 9ef1c6fdff
commit 2434b154ab
@@ -49,6 +49,22 @@ Admin.prototype = {
listen: function() {
},
/**
* Load a new page using an AJAX request.
*
* @this Admin
* @param {Object} e - event object
*/
page_loader: function(e) {
var $link = get_target(e);
e.preventDefault();
if ($link.hasClass("navigation")) {
$(".sidebar li.active").removeClass("active");
$link.parent().addClass("active");
}
this.navobj.baseurl($link.attr("href")).update();
},
importform_cb: function() {
$(".submit").one('click', function(e) {
e.preventDefault();
@@ -111,6 +127,14 @@ Domains.prototype = {
this.register_tag_handler("dom");
},
/**
* Custom callbacks declaration.
*/
listen: function() {
Admin.prototype.listen.call(this);
$(document).on("click", "a.ajaxnav", $.proxy(this.page_loader, this));
},
/**
* Initialize the domain links embedded within a page.
*
@@ -270,16 +294,6 @@ Identities.prototype = {
$(document).on("click", "a.ajaxcall", $.proxy(this.send_call, this));
},
page_loader: function(e) {
var $link = get_target(e);
e.preventDefault();
if ($link.hasClass("navigation")) {
$(".sidebar li.active").removeClass("active");
$link.parent().addClass("active");
}
this.navobj.baseurl($link.attr("href")).update();
},
/**
* Send an ajax call.
*/