From 46029bd557d5fc9f7b1d00f31082bcfdfe154a86 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 2 Feb 2021 10:24:22 +0800 Subject: [PATCH] roojs-bootstrap.js roojs-bootstrap-debug.js Roo/bootstrap/panel/Content.js --- Roo/bootstrap/panel/Content.js | 4 +++- roojs-bootstrap-debug.js | 12 ++++++++++++ roojs-bootstrap.js | 6 +++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Roo/bootstrap/panel/Content.js b/Roo/bootstrap/panel/Content.js index 3c3df3e2d3..b6670a831e 100644 --- a/Roo/bootstrap/panel/Content.js +++ b/Roo/bootstrap/panel/Content.js @@ -292,6 +292,7 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, { }, /** * Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}. + * Does not work with IFRAME contents * @param {Object/String/Function} url The url for this request or a function to call to get the url or a config object containing any of the following options:

 panel.load({
@@ -306,6 +307,7 @@ panel.load({
     scripts: false
 });
 
+ * The only required property is url. The optional properties nocache, text and scripts * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their associated property on this panel UpdateManager instance. * @param {String/Object} params (optional) The parameters to pass as either a URL encoded string "param1=1&param2=2" or an object {param1: 1, param2: 2} @@ -335,7 +337,7 @@ panel.load({ setUrl : function(url, params, loadOnce){ if (this.iframe) { this.iframeEl.dom.src = url; - return; + return false; } if(this.refreshDelegate){ diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index e8365f0171..68d8ee476c 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -39741,6 +39741,7 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, { }, /** * Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}. + * Does not work with IFRAME contents * @param {Object/String/Function} url The url for this request or a function to call to get the url or a config object containing any of the following options:

 panel.load({
@@ -39755,6 +39756,7 @@ panel.load({
     scripts: false
 });
 
+ * The only required property is url. The optional properties nocache, text and scripts * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their associated property on this panel UpdateManager instance. * @param {String/Object} params (optional) The parameters to pass as either a URL encoded string "param1=1&param2=2" or an object {param1: 1, param2: 2} @@ -39763,6 +39765,11 @@ panel.load({ * @return {Roo.ContentPanel} this */ load : function(){ + + if (this.iframe) { + return this; + } + var um = this.el.getUpdateManager(); um.update.apply(um, arguments); return this; @@ -39777,6 +39784,11 @@ panel.load({ * @return {Roo.UpdateManager} The UpdateManager */ setUrl : function(url, params, loadOnce){ + if (this.iframe) { + this.iframeEl.dom.src = url; + return; + } + if(this.refreshDelegate){ this.removeListener("activate", this.refreshDelegate); } diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 74192c85f7..c75a5ff87c 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -1708,9 +1708,9 @@ this.view=Roo.factory(this.view);this.view.render&&this.view.render(false,'');}t this.setActiveClass(A&&!this.background);},setActiveClass:function(A){if(A){this.el.replaceClass("roo-layout-inactive-content","roo-layout-active-content");this.el.setStyle('position','relative');}else{this.el.replaceClass("roo-layout-active-content","roo-layout-inactive-content"); this.el.setStyle('position','absolute');}},getToolbar:function(){return this.toolbar;},setActiveState:function(A){this.active=A;this.setActiveClass(A);if(!A){if(this.fireEvent("deactivate",this)===false){return false;}return true;}this.fireEvent("activate",this); return true;},setContent:function(A,B){if(this.iframe){return;}this.el.update(A,B);},ignoreResize:function(w,h){if(this.lastSize&&this.lastSize.width==w&&this.lastSize.height==h){return true;}else{this.lastSize={width:w,height:h};return false;}},getUpdateManager:function(){if(this.iframe){return false; -}return this.el.getUpdateManager();},load:function(){var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate);}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]); -this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.el.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this));}},_setLoaded:function(){this.loaded=true; -},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl(); +}return this.el.getUpdateManager();},load:function(){if(this.iframe){return this;}var um=this.el.getUpdateManager();um.update.apply(um,arguments);return this;},setUrl:function(A,B,C){if(this.iframe){this.iframeEl.dom.src=A;return;}if(this.refreshDelegate){this.removeListener("activate",this.refreshDelegate); +}this.refreshDelegate=this._handleRefresh.createDelegate(this,[A,B,C]);this.on("activate",this.refreshDelegate);return this.el.getUpdateManager();},_handleRefresh:function(A,B,C){if(!C||!this.loaded){var D=this.el.getUpdateManager();D.update(A,B,this._setLoaded.createDelegate(this)); +}},_setLoaded:function(){this.loaded=true;},getId:function(){return this.el.id;},getEl:function(){return this.wrapEl||this.el;},adjustForComponents:function(A,B){if(this.resizeEl!=this.el){A-=this.el.getFrameWidth('lr');B-=this.el.getFrameWidth('tb');}if(this.toolbar){var te=this.toolbar.getEl(); te.setWidth(A);B-=te.getHeight();}if(this.footer){var te=this.footer.getEl();te.setWidth(A);B-=te.getHeight();}if(this.adjustments){A+=this.adjustments[0];B+=this.adjustments[1];}return {"width":A,"height":B};},setSize:function(A,B){if(this.fitToFrame&&!this.ignoreResize(A,B)){if(this.fitContainer&&this.resizeEl!=this.el){this.el.setSize(A,B); }var C=this.adjustForComponents(A,B);this.resizeEl.setSize(this.autoWidth?"auto":C.width,this.autoHeight?"auto":C.height);this.fireEvent('resize',this,C.width,C.height);}},getTitle:function(){if(typeof(this.title)!='object'){return this.title;}var t='';for(var k in this.title){if(!this.title.hasOwnProperty(k)){continue; }if(k.indexOf('-')>=0){var s=k.split('-');for(var i=0;i"+this.title[k]+"";}}else{t+=""+this.title[k]+"";}}return t;},setTitle:function(A){this.title=A;if(this.region){this.region.updatePanelTitle(this,A); -- 2.39.2