MINOR Debug messages for tracking down JS layout sequence issues (disabled by default)

This commit is contained in:
Ingo Schommer 2012-05-30 20:57:18 +02:00
parent c037ee8cbd
commit 460148c12a
4 changed files with 16 additions and 0 deletions

View File

@ -23,6 +23,8 @@
},
redraw: function() {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
// Force initialization of tabsets to avoid layout glitches
this.add(this.find('.cms-tabset')).redrawTabs();

View File

@ -195,6 +195,8 @@
this[this.hasClass('is-collapsed') ? 'expand' : 'collapse']();
},
redraw: function() {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
this.layout();
}
});

View File

@ -339,6 +339,8 @@
this.redraw();
},
redraw: function(type) {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
$('.cms-tree')
.toggleClass('draggable', this.val() == 'draggable')
.toggleClass('multiple', this.val() == 'multiselect');

View File

@ -125,6 +125,8 @@ jQuery.noConflict();
},
redraw: function() {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
// Move from inner to outer layouts. Some of the elements might not exist.
// Not all edit forms are layouted, so qualify by their data value.
this.find('.cms-content-fields[data-layout-type]').redraw();
@ -306,6 +308,8 @@ jQuery.noConflict();
$('.cms-content-fields').entwine({
redraw: function() {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
this.layout();
}
});
@ -456,6 +460,8 @@ jQuery.noConflict();
this._super();
},
redraw: function() {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
// Remove whitespace to avoid gaps with inline elements
this.contents().filter(function() {
return (this.nodeType == 3 && !/\S/.test(this.nodeValue));
@ -535,6 +541,8 @@ jQuery.noConflict();
$(".cms-panel-layout").entwine({
redraw: function() {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
this.layout({
resize: false
});
@ -626,6 +634,8 @@ jQuery.noConflict();
this._super();
},
redraw: function() {
if(window.debug) console.log('redraw', this.attr('class'), this.get(0));
var self = this, url = this.data('url');
if(!url) throw 'Elements of class .cms-panel-deferred need a "data-url" attribute';