From c67ef17e86bf7472ffd62d6c03bb76764bf83bb0 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 10 Oct 2013 11:29:35 +0200 Subject: [PATCH] js/link target: Replace detail container from url when the a tag's data-icinga-target attribute is set to 'detail' refs #4823 --- public/js/icinga/components/container.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/js/icinga/components/container.js b/public/js/icinga/components/container.js index c50173a76..b568abb33 100644 --- a/public/js/icinga/components/container.js +++ b/public/js/icinga/components/container.js @@ -488,10 +488,15 @@ define(['jquery', 'logging', 'icinga/componentLoader', 'URIjs/URI', 'URIjs/URITe if (Container.isExternalLink($(targetEl).attr('href'))) { return true; } else { - // detail links render to main by default; - Icinga.replaceBodyFromUrl( - mainContainer.updateContainerHref(URI($(targetEl).attr('href')).href()) - ); + if ($(targetEl).attr('data-icinga-target') === 'detail') { + Icinga.replaceBodyFromUrl( + detailContainer.updateContainerHref(URI($(targetEl).attr('href')).href()) + ); + } else { + Icinga.replaceBodyFromUrl( + mainContainer.updateContainerHref(URI($(targetEl).attr('href')).href()) + ); + } ev.preventDefault(); ev.stopPropagation(); @@ -512,4 +517,4 @@ define(['jquery', 'logging', 'icinga/componentLoader', 'URIjs/URI', 'URIjs/URITe }; return Container; -}); \ No newline at end of file +});