mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR Delegated JavaScript layout from .cms-container to redraw() methods on the individual panels
This commit is contained in:
parent
5062dd9393
commit
c06d52dce2
@ -47,6 +47,10 @@
|
||||
this._super();
|
||||
},
|
||||
|
||||
redraw: function() {
|
||||
this.layout();
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: loadForm
|
||||
*
|
||||
@ -73,8 +77,6 @@
|
||||
|
||||
this.trigger('loadform', {form: form, url: url});
|
||||
|
||||
form.cleanup();
|
||||
|
||||
return jQuery.ajax(jQuery.extend({
|
||||
url: url,
|
||||
// Ensure that form view is loaded (rather than whole "Content" template)
|
||||
@ -203,7 +205,6 @@
|
||||
* @return {jQuery} New form element
|
||||
*/
|
||||
replaceForm: function(form, html) {
|
||||
form.cleanup();
|
||||
if(html) {
|
||||
var parent = form.parent(), id = form.attr('id');
|
||||
form.replaceWith(html);
|
||||
|
@ -89,6 +89,13 @@
|
||||
this._super();
|
||||
},
|
||||
|
||||
redraw: function() {
|
||||
// TODO Manually set container height before resizing - shouldn't be necessary'
|
||||
this.find('.cms-content-actions').height(this.find('.cms-content-actions .Actions').height());
|
||||
|
||||
this.layout();
|
||||
},
|
||||
|
||||
/**
|
||||
* Function: _setupChangeTracker
|
||||
*/
|
||||
|
@ -58,7 +58,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize layouts, inner to outer
|
||||
// Initialize layouts
|
||||
this.redraw();
|
||||
$(window).resize(function() {self.redraw()});
|
||||
|
||||
@ -77,10 +77,12 @@
|
||||
},
|
||||
|
||||
redraw: function() {
|
||||
// Not all edit forms are layouted
|
||||
var editForm = $('.cms-edit-form[data-layout]').layout();
|
||||
$('.cms-content').layout();
|
||||
$('.cms-container').layout({resize: false});
|
||||
// Move from inner to outer layouts. Some of the elements might not exist.
|
||||
this.find('.cms-edit-form[data-layout]').redraw(); // Not all edit forms are layouted
|
||||
this.find('.cms-preview').redraw();
|
||||
this.find('.cms-content').redraw();
|
||||
|
||||
this.layout({resize: false});
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -9,11 +9,12 @@
|
||||
*/
|
||||
$('.ss-tabset').entwine({
|
||||
onmatch: function() {
|
||||
this.redraw();
|
||||
// Can't name redraw() as it clashes with other CMS entwine classes
|
||||
this.redrawTabs();
|
||||
this._super();
|
||||
},
|
||||
|
||||
redraw: function() {
|
||||
redrawTabs: function() {
|
||||
this.rewriteHashlinks();
|
||||
|
||||
// Initialize jQuery UI tabs
|
||||
|
Loading…
x
Reference in New Issue
Block a user