js/responsiveness: respect singlecolumn layouts
Target _next now depends on current layout
This commit is contained in:
parent
0604d30348
commit
1385667edc
|
@ -561,11 +561,16 @@
|
|||
// 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();
|
||||
if (this.icinga.ui.hasOnlyOneColumn()) {
|
||||
targetId = 'col1';
|
||||
$target = $('#' + targetId);
|
||||
} else {
|
||||
if ($el.closest('#col2').length) {
|
||||
this.icinga.ui.moveToLeft();
|
||||
}
|
||||
targetId = 'col2';
|
||||
$target = $('#' + targetId);
|
||||
}
|
||||
targetId = 'col2';
|
||||
$target = $('#' + targetId);
|
||||
} else if (targetId === '_self') {
|
||||
$target = $el.closest('.container');
|
||||
targetId = $target.attr('id');
|
||||
|
|
|
@ -196,6 +196,10 @@
|
|||
self.refreshDebug();
|
||||
},
|
||||
|
||||
hasOnlyOneColumn: function () {
|
||||
return this.currentLayout === 'poor' || this.currentLayout === 'minimal';
|
||||
},
|
||||
|
||||
layoutHasBeenChanged: function () {
|
||||
|
||||
var layout = $('html').css('fontFamily').replace(/['",]/g, '');
|
||||
|
|
Loading…
Reference in New Issue