MINOR Fixed button layout height adjustment in CMS, reduced redraw() invocations on cms-edit-form

This commit is contained in:
Ingo Schommer 2011-12-15 22:04:03 +01:00
parent adb5acc8bb
commit bf11a32336
3 changed files with 15 additions and 9 deletions

View File

@ -100,8 +100,8 @@
// Force initialization of tabsets to avoid layout glitches
this.add(this.find('.ss-tabset')).redrawTabs();
// TODO Manually set container height before resizing - shouldn't be necessary'
this.find('.cms-content-actions').height(this.find('.cms-content-actions .Actions').height());
var approxWidth = $('.cms-container').width() - $('.cms-menu').width();
this.find('.cms-content-actions').width(approxWidth).height('auto');
this.layout();
},

View File

@ -90,9 +90,12 @@
redraw: function() {
// 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-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});
@ -222,9 +225,8 @@
*/
$('.cms-container input[type="submit"], .cms-container button, .cms-container input[type="reset"]').entwine({
onmatch: function() {
// TODO Adding classes in onmatch confuses entwine
var self = this;
setTimeout(function() {self.addClass('ss-ui-button');}, 10);
this.addClass('ss-ui-button');
this.redraw();
this._super();
}

View File

@ -5,6 +5,12 @@
* Constructor: onmatch
*/
onmatch: function() {
this.redraw();
this._super();
},
redraw: function() {
this.addClass(
'ui-state-default ' +
'ui-corner-all'
@ -33,8 +39,6 @@
setTimeout(function() {form.clickedButton = null;}, 10);
}
});
this._super();
}
});