From: Alan Knowles Date: Thu, 19 Aug 2021 06:02:49 +0000 (+0800) Subject: revet delay on chrome for window resize X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=cd50d578e28c09f49ddfffc4653da900b3fadc3c revet delay on chrome for window resize --- diff --git a/Roo/EventManager.js b/Roo/EventManager.js index c07d91daf4..80c03001d5 100644 --- a/Roo/EventManager.js +++ b/Roo/EventManager.js @@ -370,7 +370,8 @@ el.on({ * @param {Object} scope An object that becomes the scope of the handler * @param {boolean} options */ - onWindowResize : function(fn, scope, options){ + onWindowResize : function(fn, scope, options) + { if(!resizeEvent){ resizeEvent = new Roo.util.Event(); resizeTask = new Roo.util.DelayedTask(function(){ @@ -378,12 +379,11 @@ el.on({ }); E.on(window, "resize", function() { - // it seems that even chrome likes to have a slight delay here. - //if(Roo.isIE){ + if (Roo.isIE) { resizeTask.delay(50); - //}else{ - // resizeEvent.fire(D.getViewWidth(), D.getViewHeight()); - //} + } else { + resizeEvent.fire(D.getViewWidth(), D.getViewHeight()); + } }); } resizeEvent.addListener(fn, scope, options); diff --git a/docs/src/Roo_bootstrap_Modal.js.html b/docs/src/Roo_bootstrap_Modal.js.html index d433c920cd..e59aee6922 100644 --- a/docs/src/Roo_bootstrap_Modal.js.html +++ b/docs/src/Roo_bootstrap_Modal.js.html @@ -166,6 +166,8 @@ delete this.items; for(var i =0;i < items.length;i++) { + // we force children not to montor widnow resize - as we do that for them. + items[i].monitorWindowResize = false; nitems.push(this.addxtype(Roo.apply({}, items[i]))); } } @@ -373,6 +375,14 @@ } this.resizeTo(w,h); + // any layout/border etc.. resize.. + (function () { + this.items.forEach( function(e) { + e.layout ? e.layout() : false; + + }); + }).defer(100,this); + }, show : function() { @@ -418,7 +428,9 @@ // set zindex here - otherwise it appears to be ignored... this.el.setStyle('z-index', Roo.bootstrap.Modal.zIndex++); - (function () { + + // this is for children that are... layout.Border + (function () { this.items.forEach( function(e) { e.layout ? e.layout() : false; diff --git a/docs/src/Roo_bootstrap_layout_Manager.js.html b/docs/src/Roo_bootstrap_layout_Manager.js.html index 5da8697f0e..89721c5a52 100644 --- a/docs/src/Roo_bootstrap_layout_Manager.js.html +++ b/docs/src/Roo_bootstrap_layout_Manager.js.html @@ -17,6 +17,8 @@ */ Roo.bootstrap.layout.Manager = function(config) { + this.monitorWindowResize = true; // do this before we apply configuration. + Roo.bootstrap.layout.Manager.superclass.constructor.call(this,config); @@ -24,7 +26,7 @@ /** false to disable window resize monitoring @type Boolean */ - this.monitorWindowResize = true; + this.regions = {}; this.addEvents({ /** diff --git a/docs/src/Roo_bootstrap_panel_Content.js.html b/docs/src/Roo_bootstrap_panel_Content.js.html index 1083e39794..83e456d945 100644 --- a/docs/src/Roo_bootstrap_panel_Content.js.html +++ b/docs/src/Roo_bootstrap_panel_Content.js.html @@ -287,7 +287,7 @@ ignoreResize : function(w, h) { - return false; // always resize? + //return false; // always resize? if(this.lastSize && this.lastSize.width == w && this.lastSize.height == h){ return true; }else{ diff --git a/docs/src/Roo_bootstrap_panel_Grid.js.html b/docs/src/Roo_bootstrap_panel_Grid.js.html index 21c53b864a..81efccfbb5 100644 --- a/docs/src/Roo_bootstrap_panel_Grid.js.html +++ b/docs/src/Roo_bootstrap_panel_Grid.js.html @@ -98,8 +98,6 @@ Roo.extend(Roo.bootstrap.panel.Grid, Roo.bootstrap.panel.Content, { - // private - is_resizing : false, getId : function(){ return this.grid.id; @@ -115,12 +113,8 @@ setSize : function(width, height) { - if (this.is_resizing) { - return; - } - this.is_resizing = true; - if(!this.ignoreResize(width, height)){ + //if(!this.ignoreResize(width, height)){ var grid = this.grid; var size = this.adjustForComponents(width, height); // tfoot is not a footer? @@ -148,9 +142,9 @@ //} grid.autoSize(); - } - this.is_resizing = false; - }, + //} + + },