mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed cms menu expansion logic when shown alongside preview panel, retain cookie preference
This commit is contained in:
parent
e185a9b8f8
commit
d23e8ec14c
@ -69,15 +69,18 @@
|
|||||||
updateAfterXhr();
|
updateAfterXhr();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Toggle preview when new menu entry is selected
|
// Toggle preview when new menu entry is selected.
|
||||||
|
// Only do this when preview is actually shown,
|
||||||
|
// to avoid auto-expanding the menu in normal CMS mode
|
||||||
$('.cms-menu-list li').bind('select', function(e) {
|
$('.cms-menu-list li').bind('select', function(e) {
|
||||||
self.collapse();
|
if(!self.hasClass('is-collapsed')) self.collapse();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.layout({type: 'border'});
|
this.layout({type: 'border'});
|
||||||
|
|
||||||
if(this.hasClass('is-expanded')) this.expand();
|
if(this.hasClass('is-expanded')) this.expand();
|
||||||
else this.collapse();
|
else this.collapse();
|
||||||
|
this.data('cms-preview-initialized', true);
|
||||||
|
|
||||||
// Preview might not be available in all admin interfaces - block/disable when necessary
|
// Preview might not be available in all admin interfaces - block/disable when necessary
|
||||||
this.append('<div class="cms-preview-overlay ui-widget-overlay-light"></div>');
|
this.append('<div class="cms-preview-overlay ui-widget-overlay-light"></div>');
|
||||||
@ -142,7 +145,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
expand: function() {
|
expand: function(inclMenu) {
|
||||||
var self = this, containerEl = this.getLayoutContainer(), contentEl = containerEl.find('.cms-content');
|
var self = this, containerEl = this.getLayoutContainer(), contentEl = containerEl.find('.cms-content');
|
||||||
this.removeClass('east').addClass('center').removeClass('is-collapsed');
|
this.removeClass('east').addClass('center').removeClass('is-collapsed');
|
||||||
// this.css('overflow', 'auto');
|
// this.css('overflow', 'auto');
|
||||||
@ -150,7 +153,10 @@
|
|||||||
this.find('iframe').show();
|
this.find('iframe').show();
|
||||||
this.find('.cms-preview-toggle a').html('»');
|
this.find('.cms-preview-toggle a').html('»');
|
||||||
this.find('.cms-preview-controls').show();
|
this.find('.cms-preview-controls').show();
|
||||||
containerEl.find('.cms-menu').collapsePanel();
|
|
||||||
|
if(this.data('cms-preview-initialized')) {
|
||||||
|
containerEl.find('.cms-menu').collapsePanel();
|
||||||
|
}
|
||||||
|
|
||||||
// Already triggered through panel toggle above
|
// Already triggered through panel toggle above
|
||||||
// containerEl.redraw();
|
// containerEl.redraw();
|
||||||
@ -164,7 +170,10 @@
|
|||||||
this.find('iframe').hide();
|
this.find('iframe').hide();
|
||||||
this.find('.cms-preview-toggle a').html('«');
|
this.find('.cms-preview-toggle a').html('«');
|
||||||
this.find('.cms-preview-controls').hide();
|
this.find('.cms-preview-controls').hide();
|
||||||
containerEl.find('.cms-menu').expandPanel();
|
|
||||||
|
if(this.data('cms-preview-initialized')) {
|
||||||
|
containerEl.find('.cms-menu').expandPanel();
|
||||||
|
}
|
||||||
|
|
||||||
// Already triggered through panel toggle above
|
// Already triggered through panel toggle above
|
||||||
// containerEl.redraw();
|
// containerEl.redraw();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user