Add history api and modify js for tests
All JS Files now call 'requirejs' instead of 'require', also the holder.js reference is removed and the history api added. Tests are following in the next commit refs #4303 refs #4315
This commit is contained in:
parent
b46dd9bae4
commit
0694973c88
|
@ -34,14 +34,14 @@
|
|||
}
|
||||
target.focus();
|
||||
this.initializeContainers(target);
|
||||
holder.run();
|
||||
|
||||
};
|
||||
|
||||
this.updateControlTargets = function(ctrl, req) {
|
||||
$('a',ctrl).each(function() {
|
||||
$(this).attr("href",req.url);
|
||||
});
|
||||
holder.run();
|
||||
|
||||
};
|
||||
|
||||
this.initControlBehaviour = function(root) {
|
||||
|
@ -86,7 +86,7 @@
|
|||
this.initExpandables(root);
|
||||
this.drawImplicitWidgets(root);
|
||||
this.loadAsyncContainers(root);
|
||||
holder.run();
|
||||
|
||||
};
|
||||
|
||||
this.createPopupContainer = function(content,req) {
|
||||
|
@ -96,7 +96,7 @@
|
|||
.append($("<div>").addClass('modal-body').html(content)).appendTo(document.body);
|
||||
|
||||
closeButton.on("click",function() {container.remove();});
|
||||
holder.run();
|
||||
|
||||
};
|
||||
|
||||
this.getContainer = function(id) {
|
||||
|
@ -104,9 +104,9 @@
|
|||
};
|
||||
|
||||
};
|
||||
define(['jquery','logging','icinga/widgets/checkIcons','icinga/widgets/subTable','Holder'],function($,log,widgets,subTable,holder) {
|
||||
define(['jquery','logging','icinga/widgets/checkIcons','icinga/widgets/subTable'], function($,log,widgets,subTable) {
|
||||
if (containerMgrInstance === null) {
|
||||
containerMgrInstance = new ContainerMgr($,log,widgets,subTable,holder);
|
||||
containerMgrInstance = new ContainerMgr($,log,widgets,subTable);
|
||||
}
|
||||
return containerMgrInstance;
|
||||
|
||||
|
|
|
@ -68,6 +68,12 @@ define([
|
|||
|
||||
},
|
||||
|
||||
loadUrl: function(url, target, params) {
|
||||
target = target || "icinga-main";
|
||||
async.loadToTarget(target, url, params);
|
||||
History.pushState(params, document.title, url);
|
||||
},
|
||||
|
||||
getFailedModules: function() {
|
||||
return failedModules;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"use strict";
|
||||
var asyncMgrInstance = null;
|
||||
|
||||
define(['icinga/container','logging','icinga/behaviour','jquery'],function(containerMgr,log,behaviour,$) {
|
||||
define(['icinga/container','logging','jquery'],function(containerMgr,log,$) {
|
||||
|
||||
|
||||
var pending = {
|
||||
|
@ -21,7 +21,6 @@
|
|||
};
|
||||
|
||||
var handleResponse = function(html) {
|
||||
|
||||
if(this.destination) {
|
||||
containerMgr.updateContainer(this.destination,html,this);
|
||||
} else {
|
||||
|
@ -94,7 +93,13 @@
|
|||
});
|
||||
req.destination = destination;
|
||||
}
|
||||
|
||||
if (destination == "icinga-main") {
|
||||
History.pushState(data, document.title, url);
|
||||
} else {
|
||||
data = data || {};
|
||||
data[destination] = url;
|
||||
History.pushState(data, document.title, document.location.href);
|
||||
}
|
||||
return req;
|
||||
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue