Better link target discovery, support _blank

This commit is contained in:
Thomas Gelf 2014-02-21 10:15:22 +00:00
parent 1b4f055bfa
commit 072eda70c4
1 changed files with 7 additions and 1 deletions

View File

@ -146,6 +146,9 @@
var $a = $(this);
var href = $a.attr('href');
if ($a.attr('target') === '_blank') {
return true;
}
event.stopPropagation();
event.preventDefault();
if (href === '#') {
@ -158,6 +161,9 @@
}
var $target = $('#col1');
var $container = $a.closest('.container');
if ($container.length) {
$target = $container;
}
// If link is hash tag...
if ($a.closest('table').length) {
$target = $('#col2');
@ -165,7 +171,7 @@
icinga.ui.fixControls();
}
if ($a.closest('[data-base-target]').length) {
$target = $('#' + $a.closest('[data-base-target]').data('base-target'));
$target = $('#' + $a.closest('[data-base-target]').data('baseTarget'));
$('#layout').addClass('twocols');
icinga.ui.fixControls();
}