Better JS link target detection, fix a few edge cases
This commit is contained in:
parent
e1de4e384a
commit
e8a783a44a
|
@ -270,19 +270,24 @@
|
|||
targetId = $el.closest('[data-base-target]').data('baseTarget');
|
||||
|
||||
// Simulate _next to prepare migration to dynamic column layout
|
||||
// YES, there are duplicate lines right now.
|
||||
if (targetId === '_next') {
|
||||
if ($el.closest('#col2').length) {
|
||||
this.icinga.ui.moveToLeft();
|
||||
}
|
||||
targetId = 'col2';
|
||||
}
|
||||
|
||||
if (targetId === '_main') {
|
||||
$target = $('#' + targetId);
|
||||
} else if (targetId === '_self') {
|
||||
$target = $el.closest('.container');
|
||||
targetId = $target.attr('id');
|
||||
} else if (targetId === '_main') {
|
||||
targetId = 'col1';
|
||||
$target = $('#' + targetId);
|
||||
icinga.ui.layout1col();
|
||||
} else {
|
||||
$target = $('#' + targetId);
|
||||
}
|
||||
|
||||
$target = $('#' + targetId);
|
||||
}
|
||||
|
||||
// Hardcoded layout switch unless columns are dynamic
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
},
|
||||
|
||||
cutContainer: function ($col) {
|
||||
return {
|
||||
var props = {
|
||||
'elements': $('#' + $col.attr('id') + ' > div').detach(),
|
||||
'data': {
|
||||
'data-icinga-url': $col.data('icingaUrl'),
|
||||
|
@ -108,7 +108,14 @@
|
|||
'data-icinga-module': $col.data('icingaModule')
|
||||
},
|
||||
'class': $col.attr('class')
|
||||
}
|
||||
};
|
||||
this.icinga.loader.stopPendingRequestsFor($col);
|
||||
$col.removeData('icingaUrl');
|
||||
$col.removeData('icingaRefresh');
|
||||
$col.removeData('lastUpdate');
|
||||
$col.removeData('icingaModule');
|
||||
$col.removeAttr('class').attr('class', 'container');
|
||||
return props;
|
||||
},
|
||||
|
||||
pasteContainer: function ($col, backup) {
|
||||
|
|
Loading…
Reference in New Issue