diff --git a/application/layouts/scripts/parts/navigation.phtml b/application/layouts/scripts/parts/navigation.phtml
index 1184d1830..e7de8f369 100755
--- a/application/layouts/scripts/parts/navigation.phtml
+++ b/application/layouts/scripts/parts/navigation.phtml
@@ -5,7 +5,8 @@
$item = $this->navigation->listAll("menu");
?>
-auth()->isAuthenticated()): ?>
+auth()->isAuthenticated()): ?>
+
-
view->baseUrl($url) : $baseUrl . $url;
}
}
-// @codingStandardsIgnoreEnd
\ No newline at end of file
+// @codingStandardsIgnoreEnd
diff --git a/public/js/icinga/modules/mainDetail.js b/public/js/icinga/modules/mainDetail.js
index 9a207c933..368c5c5f7 100755
--- a/public/js/icinga/modules/mainDetail.js
+++ b/public/js/icinga/modules/mainDetail.js
@@ -16,45 +16,52 @@ define(['jquery','logging','icinga/util/async'],function($,log,async) {
href = a.attr("href");
ev.stopImmediatePropagation();
collapseDetailView();
+ async.loadToTarget("icinga-main",href);
+ return false;
+};
+
+var onLinkTagClick = function(ev) {
+
+ var a = $(ev.currentTarget),
+ target = a.attr("target"),
+ href = a.attr("href");
+
+ // check for protocol://
+ if(/^[A-Z]{2,10}\:\/\//i.test(href)) {
+ window.open(href);
+ ev.stopImmediatePropagation();
+ return false;
+ }
+
+ // check for link in table header
+ if(a.parents('th').length > 0) {
+ ev.stopImmediatePropagation();
+ return false;
+ }
+
+ if(typeof target === "undefined") {
+ if(a.parents("#icinga-detail").length) {
+ log.debug("Parent is detail, loading into detail");
+ async.loadToTarget("icinga-detail",href);
+ } else {
+ log.debug("Parent is not detail, loading into main");
async.loadToTarget("icinga-main",href);
- return false;
- };
-
- var onLinkTagClick = function(ev) {
-
- var a = $(ev.currentTarget),
- target = a.attr("target"),
- href = a.attr("href");
-
- // check for protocol://
- if(/^[A-Z]{2,10}\:\/\//i.test(href)) {
- window.open(href);
- ev.stopImmediatePropagation();
- return false;
- }
-
- // check for link in table header
- if(a.parents('th').length > 0) {
- ev.stopImmediatePropagation();
- return false;
- }
-
- if(typeof target === "undefined") {
- if(a.parents("#icinga-detail").length) {
- async.loadToTarget("icinga-detail",href);
- } else {
- async.loadToTarget("icinga-main",href);
- }
- } else {
- switch(target) {
+ }
+ } else {
+ switch(target) {
+ case "body":
+ async.loadToTarget("body", href);
+ break;
case "main":
async.loadToTarget("icinga-main",href);
collapseDetailView();
break;
case "detail":
+ log.debug("Target: detail");
async.loadToTarget("icinga-detail",href);
break;
case "popup":
+ log.debug("No target");
async.loadToTarget(null,href);
break;
default:
@@ -67,7 +74,7 @@ define(['jquery','logging','icinga/util/async'],function($,log,async) {
var expandDetailView = function() {
$("#icinga-detail").parents(".collapsed").removeClass('collapsed');
- };
+ };
var collapseDetailView = function(elementInDetailView) {
$("#icinga-detail").parents(".layout-main-detail").addClass('collapsed');
@@ -88,7 +95,5 @@ define(['jquery','logging','icinga/util/async'],function($,log,async) {
}
};
};
-
return new MainDetailBehaviour();
});
-
diff --git a/public/js/icinga/util/async.js b/public/js/icinga/util/async.js
index efab52ed7..8e015b45a 100644
--- a/public/js/icinga/util/async.js
+++ b/public/js/icinga/util/async.js
@@ -5,11 +5,9 @@
define(['icinga/container','logging','icinga/behaviour','jquery'],function(containerMgr,log,behaviour,$) {
-
var pending = {
};
-
var getDOMForDestination = function(destination) {
var target = destination;
if(typeof destination === "string") {
@@ -84,13 +82,14 @@
this.loadToTarget = function(destination,url,data) {
if(destination) {
+ log.debug("Laoding to container", destination, url);
this.clearPendingRequestsFor(destination);
}
var req = this.createRequest(url,data);
if(destination) {
pending.push({
request: req,
- DOM: getDOMForDestination(destination)
+ DOM: getDOMForDestination(destination)
});
req.destination = destination;
}
@@ -105,5 +104,4 @@
};
return new CallInterface();
});
-
-})();
\ No newline at end of file
+})();