roojs-bootstrap.js
authorAlan Knowles <alan@roojs.com>
Tue, 2 Feb 2021 02:23:24 +0000 (10:23 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 2 Feb 2021 02:23:24 +0000 (10:23 +0800)
roojs-bootstrap-debug.js
Roo/bootstrap/panel/Content.js

Roo/bootstrap/panel/Content.js
roojs-bootstrap-debug.js
roojs-bootstrap.js

index 617937f..2770e59 100644 (file)
@@ -285,6 +285,9 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, {
      * @return {Roo.UpdateManager} The UpdateManager
      */
     getUpdateManager : function(){
+        if (this.iframe) {
+            return false;
+        }
         return this.el.getUpdateManager();
     },
      /**
index b65f8ba..e8365f0 100644 (file)
@@ -39530,6 +39530,10 @@ Roo.bootstrap.panel.Content = function( config){
             }
                         
             this.el = Roo.DomHelper.append(document.body, elcfg , true);
+            if (this.iframe) {
+                this.iframeEl = this.el.select('iframe',true).first();
+            }
+            
         }
     } 
     this.closable = false;
@@ -39626,7 +39630,7 @@ Roo.bootstrap.panel.Content = function( config){
 
     
     
-    if(this.autoScroll){
+    if(this.autoScroll && !this.iframe){
         this.resizeEl.setStyle("overflow", "auto");
     } else {
         // fix randome scrolling
@@ -39705,11 +39709,15 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, {
         return true;
     },
     /**
-     * Updates this panel's element
+     * Updates this panel's element (not for iframe)
      * @param {String} content The new content
      * @param {Boolean} loadScripts (optional) true to look for and process scripts
     */
     setContent : function(content, loadScripts){
+        if (this.iframe) {
+            return;
+        }
+        
         this.el.update(content, loadScripts);
     },
 
@@ -39726,6 +39734,9 @@ Roo.extend(Roo.bootstrap.panel.Content, Roo.bootstrap.Component, {
      * @return {Roo.UpdateManager} The UpdateManager
      */
     getUpdateManager : function(){
+        if (this.iframe) {
+            return false;
+        }
         return this.el.getUpdateManager();
     },
      /**
index 207ab8b..74192c8 100644 (file)
@@ -1700,15 +1700,15 @@ Roo.namespace("Roo.bootstrap.panel");
 // Roo/bootstrap/panel/Content.js
 Roo.bootstrap.panel.Content=function(A){this.tpl=A.tpl||false;var el=A.el;var B=A.content;if(A.autoCreate){el=Roo.id();}this.el=Roo.get(el);if(!this.el&&A&&A.autoCreate){if(typeof A.autoCreate=="object"){if(!A.autoCreate.id){A.autoCreate.id=A.id||el;}this.el=Roo.DomHelper.append(document.body,A.autoCreate,true);
 }else{var C={tag:"div",cls:(A.cls||'')+(A.background?' bg-'+A.background:'')+" roo-layout-inactive-content",id:A.id||el};if(this.iframe){C.cn=[{tag:'iframe',style:'border 0px',src:'about:blank'}];}if(A.html){C.html=A.html;}this.el=Roo.DomHelper.append(document.body,C,true);
-}}this.closable=false;this.loaded=false;this.active=false;if(A.toolbar&&!A.toolbar.el&&A.toolbar.xtype){this.toolbar=new A.toolbar.xns[A.toolbar.xtype](A.toolbar);this.wrapEl=this.el;var ti=[];if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;
-}var D=[];this.toolbar.render(this.wrapEl,'before');for(var i=0;i<ti.length;i++){D.push(this.toolbar.addxtype(Roo.apply({},ti[i])));}this.toolbar.items=D;this.toolbar.el.insertBefore(this.wrapEl.dom.firstChild);delete A.toolbar;}if(typeof A=="string"){this.title=A;
-}else{Roo.apply(this,A);}if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl,true);}else{this.resizeEl=this.el;}this.addEvents({"activate":true,"deactivate":true,"resize":true,"render":true});if(this.autoScroll){this.resizeEl.setStyle("overflow","auto");
+if(this.iframe){this.iframeEl=this.el.select('iframe',true).first();}}}this.closable=false;this.loaded=false;this.active=false;if(A.toolbar&&!A.toolbar.el&&A.toolbar.xtype){this.toolbar=new A.toolbar.xns[A.toolbar.xtype](A.toolbar);this.wrapEl=this.el;var ti=[];
+if(A.toolbar.items){ti=A.toolbar.items;delete A.toolbar.items;}var D=[];this.toolbar.render(this.wrapEl,'before');for(var i=0;i<ti.length;i++){D.push(this.toolbar.addxtype(Roo.apply({},ti[i])));}this.toolbar.items=D;this.toolbar.el.insertBefore(this.wrapEl.dom.firstChild);
+delete A.toolbar;}if(typeof A=="string"){this.title=A;}else{Roo.apply(this,A);}if(this.resizeEl){this.resizeEl=Roo.get(this.resizeEl,true);}else{this.resizeEl=this.el;}this.addEvents({"activate":true,"deactivate":true,"resize":true,"render":true});if(this.autoScroll&&!this.iframe){this.resizeEl.setStyle("overflow","auto");
 }else{}B=B||this.content;if(B){this.setContent(B);}if(A&&A.url){this.setUrl(this.url,this.params,this.loadOnce);}Roo.bootstrap.panel.Content.superclass.constructor.call(this);if(this.view&&typeof(this.view.xtype)!='undefined'){this.view.el=this.el.appendChild(document.createElement("div"));
 this.view=Roo.factory(this.view);this.view.render&&this.view.render(false,'');}this.fireEvent('render',this);};Roo.extend(Roo.bootstrap.panel.Content,Roo.bootstrap.Component,{cls:'',background:'',tabTip:'',iframe:false,setRegion:function(A){this.region=A;
 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){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(){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]);
+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();
 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);