js/responsiveness: respect singlecolumn layouts

Target _next now depends on current layout
This commit is contained in:
Thomas Gelf 2014-06-24 07:46:37 +02:00
parent 0604d30348
commit 1385667edc
2 changed files with 13 additions and 4 deletions

View File

@ -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');

View File

@ -196,6 +196,10 @@
self.refreshDebug();
},
hasOnlyOneColumn: function () {
return this.currentLayout === 'poor' || this.currentLayout === 'minimal';
},
layoutHasBeenChanged: function () {
var layout = $('html').css('fontFamily').replace(/['",]/g, '');