Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Delegated JavaScript layout from .cms-container to redraw() met…

…hods on the individual panels
  • Loading branch information...
commit c06d52dce26d4ed06443e527eb12d762265a71e3 1 parent 5062dd9
@chillu chillu authored
View
7 admin/javascript/LeftAndMain.Content.js
@@ -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);
View
7 admin/javascript/LeftAndMain.EditForm.js
@@ -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
*/
View
12 admin/javascript/LeftAndMain.js
@@ -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});
},
/**
View
5 javascript/TabSet.js
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.