mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed button layout height adjustment in CMS, reduced redraw() invocations on cms-edit-form
This commit is contained in:
parent
adb5acc8bb
commit
bf11a32336
@ -100,8 +100,8 @@
|
|||||||
// Force initialization of tabsets to avoid layout glitches
|
// Force initialization of tabsets to avoid layout glitches
|
||||||
this.add(this.find('.ss-tabset')).redrawTabs();
|
this.add(this.find('.ss-tabset')).redrawTabs();
|
||||||
|
|
||||||
// TODO Manually set container height before resizing - shouldn't be necessary'
|
var approxWidth = $('.cms-container').width() - $('.cms-menu').width();
|
||||||
this.find('.cms-content-actions').height(this.find('.cms-content-actions .Actions').height());
|
this.find('.cms-content-actions').width(approxWidth).height('auto');
|
||||||
|
|
||||||
this.layout();
|
this.layout();
|
||||||
},
|
},
|
||||||
|
@ -90,9 +90,12 @@
|
|||||||
|
|
||||||
redraw: function() {
|
redraw: function() {
|
||||||
// Move from inner to outer layouts. Some of the elements might not exist.
|
// 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
|
// Not all edit forms are layouted, so qualify by their data value.
|
||||||
|
this.find('.cms-edit-form[data-layout]').redraw();
|
||||||
this.find('.cms-preview').redraw();
|
this.find('.cms-preview').redraw();
|
||||||
this.find('.cms-content').redraw();
|
// Only redraw the content area if its not the same as the edit form
|
||||||
|
var contentEl = this.find('.cms-content');
|
||||||
|
if(!contentEl.is('.cms-edit-form')) contentEl.redraw();
|
||||||
|
|
||||||
this.layout({resize: false});
|
this.layout({resize: false});
|
||||||
|
|
||||||
@ -222,9 +225,8 @@
|
|||||||
*/
|
*/
|
||||||
$('.cms-container input[type="submit"], .cms-container button, .cms-container input[type="reset"]').entwine({
|
$('.cms-container input[type="submit"], .cms-container button, .cms-container input[type="reset"]').entwine({
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
// TODO Adding classes in onmatch confuses entwine
|
this.addClass('ss-ui-button');
|
||||||
var self = this;
|
this.redraw();
|
||||||
setTimeout(function() {self.addClass('ss-ui-button');}, 10);
|
|
||||||
|
|
||||||
this._super();
|
this._super();
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,12 @@
|
|||||||
* Constructor: onmatch
|
* Constructor: onmatch
|
||||||
*/
|
*/
|
||||||
onmatch: function() {
|
onmatch: function() {
|
||||||
|
this.redraw();
|
||||||
|
|
||||||
|
this._super();
|
||||||
|
},
|
||||||
|
|
||||||
|
redraw: function() {
|
||||||
this.addClass(
|
this.addClass(
|
||||||
'ui-state-default ' +
|
'ui-state-default ' +
|
||||||
'ui-corner-all'
|
'ui-corner-all'
|
||||||
@ -33,8 +39,6 @@
|
|||||||
setTimeout(function() {form.clickedButton = null;}, 10);
|
setTimeout(function() {form.clickedButton = null;}, 10);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this._super();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user