X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FBasicDialog.js;h=d8034fdab830af09e3f2ff5627010c98c0e52ea3;hb=refs%2Fheads%2Fwip_leon_T7094_logo_image_upload_in_boilerplate;hp=9c26ab7349e91ac0f52341793f418f9de5a2f104;hpb=3676af4483523e67a2490f62d9754455f6582ec8;p=roojs1 diff --git a/Roo/BasicDialog.js b/Roo/BasicDialog.js index 9c26ab7349..d8034fdab8 100644 --- a/Roo/BasicDialog.js +++ b/Roo/BasicDialog.js @@ -12,6 +12,7 @@ /** * @class Roo.BasicDialog * @extends Roo.util.Observable + * @parent none builder * Lightweight Dialog Class. The code below shows the creation of a typical dialog using existing HTML markup: *

 var dlg = new Roo.BasicDialog("my-dlg", {
@@ -556,15 +557,20 @@ Roo.extend(Roo.BasicDialog, Roo.util.Observable, {
     },
 
     // private
-    syncBodyHeight : function(){
-        var bd = this.body, cb = this.centerBg, bw = this.bwrap;
+    syncBodyHeight : function()
+    {
+        var bd = this.body, // the text
+            cb = this.centerBg, // wrapper around bottom.. but does not seem to be used..
+            bw = this.bwrap;
         var height = this.size.height - this.getHeaderFooterHeight(false);
         bd.setHeight(height-bd.getMargins("tb"));
         var hh = this.header.getHeight();
         var h = this.size.height-hh;
         cb.setHeight(h);
+        
         bw.setLeftTop(cb.getPadding("l"), hh+cb.getPadding("t"));
         bw.setHeight(h-cb.getPadding("tb"));
+        
         bw.setWidth(this.el.getWidth(true)-cb.getPadding("lr"));
         bd.setWidth(bw.getWidth(true));
         if(this.tabs){
@@ -1112,138 +1118,3 @@ Roo.DialogManager = function(){
         }
     };
 }();
-
-/**
- * @class Roo.LayoutDialog
- * @extends Roo.BasicDialog
- * Dialog which provides adjustments for working with a layout in a Dialog.
- * Add your necessary layout config options to the dialog's config.
- * Example usage (including a nested layout): - *

-if(!dialog){
-    dialog = new Roo.LayoutDialog("download-dlg", {
-        modal: true,
-        width:600,
-        height:450,
-        shadow:true,
-        minWidth:500,
-        minHeight:350,
-        autoTabs:true,
-        proxyDrag:true,
-        // layout config merges with the dialog config
-        center:{
-            tabPosition: "top",
-            alwaysShowTabs: true
-        }
-    });
-    dialog.addKeyListener(27, dialog.hide, dialog);
-    dialog.setDefaultButton(dialog.addButton("Close", dialog.hide, dialog));
-    dialog.addButton("Build It!", this.getDownload, this);
-
-    // we can even add nested layouts
-    var innerLayout = new Roo.BorderLayout("dl-inner", {
-        east: {
-            initialSize: 200,
-            autoScroll:true,
-            split:true
-        },
-        center: {
-            autoScroll:true
-        }
-    });
-    innerLayout.beginUpdate();
-    innerLayout.add("east", new Roo.ContentPanel("dl-details"));
-    innerLayout.add("center", new Roo.ContentPanel("selection-panel"));
-    innerLayout.endUpdate(true);
-
-    var layout = dialog.getLayout();
-    layout.beginUpdate();
-    layout.add("center", new Roo.ContentPanel("standard-panel",
-                        {title: "Download the Source", fitToFrame:true}));
-    layout.add("center", new Roo.NestedLayoutPanel(innerLayout,
-               {title: "Build your own roo.js"}));
-    layout.getRegion("center").showPanel(sp);
-    layout.endUpdate();
-}
-
- * @constructor - * @param {String/HTMLElement/Roo.Element} el The id of or container element, or config - * @param {Object} config configuration options - */ -Roo.LayoutDialog = function(el, cfg){ - - var config= cfg; - if (typeof(cfg) == 'undefined') { - config = Roo.apply({}, el); - // not sure why we use documentElement here.. - it should always be body. - // IE7 borks horribly if we use documentElement. - el = Roo.get( Roo.isIE ? (document.body || document.documentElement) : (document.documentElement || document.body) ).createChild(); - //config.autoCreate = true; - } - - - config.autoTabs = false; - Roo.LayoutDialog.superclass.constructor.call(this, el, config); - this.body.setStyle({overflow:"hidden", position:"relative"}); - this.layout = new Roo.BorderLayout(this.body.dom, config); - this.layout.monitorWindowResize = false; - this.el.addClass("x-dlg-auto-layout"); - // fix case when center region overwrites center function - this.center = Roo.BasicDialog.prototype.center; - this.on("show", this.layout.layout, this.layout, true); - if (config.items) { - var xitems = config.items; - delete config.items; - Roo.each(xitems, this.addxtype, this); - } - - -}; -Roo.extend(Roo.LayoutDialog, Roo.BasicDialog, { - /** - * Ends update of the layout and resets display to none. Use standard beginUpdate/endUpdate on the layout. - * @deprecated - */ - endUpdate : function(){ - this.layout.endUpdate(); - }, - - /** - * Begins an update of the layout and sets display to block and visibility to hidden. Use standard beginUpdate/endUpdate on the layout. - * @deprecated - */ - beginUpdate : function(){ - this.layout.beginUpdate(); - }, - - /** - * Get the BorderLayout for this dialog - * @return {Roo.BorderLayout} - */ - getLayout : function(){ - return this.layout; - }, - - showEl : function(){ - Roo.LayoutDialog.superclass.showEl.apply(this, arguments); - if(Roo.isIE7){ - this.layout.layout(); - } - }, - - // private - // Use the syncHeightBeforeShow config option to control this automatically - syncBodyHeight : function(){ - Roo.LayoutDialog.superclass.syncBodyHeight.call(this); - if(this.layout){this.layout.layout();} - }, - - /** - * Add an xtype element (actually adds to the layout.) - * @return {Object} xdata xtype object data. - */ - - addxtype : function(c) { - return this.layout.addxtype(c); - } -}); \ No newline at end of file