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();
|
this._super();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
redraw: function() {
|
||||||
|
this.layout();
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function: loadForm
|
* Function: loadForm
|
||||||
*
|
*
|
||||||
@ -73,8 +77,6 @@
|
|||||||
|
|
||||||
this.trigger('loadform', {form: form, url: url});
|
this.trigger('loadform', {form: form, url: url});
|
||||||
|
|
||||||
form.cleanup();
|
|
||||||
|
|
||||||
return jQuery.ajax(jQuery.extend({
|
return jQuery.ajax(jQuery.extend({
|
||||||
url: url,
|
url: url,
|
||||||
// Ensure that form view is loaded (rather than whole "Content" template)
|
// Ensure that form view is loaded (rather than whole "Content" template)
|
||||||
@ -203,7 +205,6 @@
|
|||||||
* @return {jQuery} New form element
|
* @return {jQuery} New form element
|
||||||
*/
|
*/
|
||||||
replaceForm: function(form, html) {
|
replaceForm: function(form, html) {
|
||||||
form.cleanup();
|
|
||||||
if(html) {
|
if(html) {
|
||||||
var parent = form.parent(), id = form.attr('id');
|
var parent = form.parent(), id = form.attr('id');
|
||||||
form.replaceWith(html);
|
form.replaceWith(html);
|
||||||
|
@ -89,6 +89,13 @@
|
|||||||
this._super();
|
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
|
* Function: _setupChangeTracker
|
||||||
*/
|
*/
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize layouts, inner to outer
|
// Initialize layouts
|
||||||
this.redraw();
|
this.redraw();
|
||||||
$(window).resize(function() {self.redraw()});
|
$(window).resize(function() {self.redraw()});
|
||||||
|
|
||||||
@ -77,10 +77,12 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
redraw: function() {
|
redraw: function() {
|
||||||
// Not all edit forms are layouted
|
// Move from inner to outer layouts. Some of the elements might not exist.
|
||||||
var editForm = $('.cms-edit-form[data-layout]').layout();
|
this.find('.cms-edit-form[data-layout]').redraw(); // Not all edit forms are layouted
|
||||||
$('.cms-content').layout();
|
this.find('.cms-preview').redraw();
|
||||||
$('.cms-container').layout({resize: false});
|
this.find('.cms-content').redraw();
|
||||||
|
|
||||||
|
this.layout({resize: false});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -9,11 +9,12 @@
|
|||||||
*/
|
*/
|
||||||
$('.ss-tabset').entwine({
|
$('.ss-tabset').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
this.redraw();
|
// Can't name redraw() as it clashes with other CMS entwine classes
|
||||||
|
this.redrawTabs();
|
||||||
this._super();
|
this._super();
|
||||||
},
|
},
|
||||||
|
|
||||||
redraw: function() {
|
redrawTabs: function() {
|
||||||
this.rewriteHashlinks();
|
this.rewriteHashlinks();
|
||||||
|
|
||||||
// Initialize jQuery UI tabs
|
// Initialize jQuery UI tabs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user