~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to gis/dhis-gis-geostat/mfbase/ext/source/legacy/layout/LayoutRegion.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Ext JS Library 2.0.2
 
3
 * Copyright(c) 2006-2008, Ext JS, LLC.
 
4
 * licensing@extjs.com
 
5
 * 
 
6
 * http://extjs.com/license
 
7
 */
 
8
 
 
9
/**
 
10
 * @class Ext.LayoutRegion
 
11
 * @extends Ext.BasicLayoutRegion
 
12
 * This class represents a region in a layout manager.
 
13
 * @cfg {Boolean} collapsible False to disable collapsing (defaults to true)
 
14
 * @cfg {Boolean} collapsed True to set the initial display to collapsed (defaults to false)
 
15
 * @cfg {Boolean} floatable False to disable floating (defaults to true)
 
16
 * @cfg {Object} margins Margins for the element (defaults to {top: 0, left: 0, right:0, bottom: 0})
 
17
 * @cfg {Object} cmargins Margins for the element when collapsed (defaults to: north/south {top: 2, left: 0, right:0, bottom: 2} or east/west {top: 0, left: 2, right:2, bottom: 0})
 
18
 * @cfg {String} tabPosition "top" or "bottom" (defaults to "bottom")
 
19
 * @cfg {String} collapsedTitle Optional string message to display in the collapsed block of a north or south region
 
20
 * @cfg {Boolean} alwaysShowTabs True to always display tabs even when there is only 1 panel (defaults to false)
 
21
 * @cfg {Boolean} autoScroll True to enable overflow scrolling (defaults to false)
 
22
 * @cfg {Boolean} titlebar True to display a title bar (defaults to true)
 
23
 * @cfg {String} title The title for the region (overrides panel titles)
 
24
 * @cfg {Boolean} animate True to animate expand/collapse (defaults to false)
 
25
 * @cfg {Boolean} autoHide False to disable auto hiding when the mouse leaves the "floated" region (defaults to true)
 
26
 * @cfg {Boolean} preservePanels True to preserve removed panels so they can be readded later (defaults to false)
 
27
 * @cfg {Boolean} closeOnTab True to place the close icon on the tabs instead of the region titlebar (defaults to false)
 
28
 * @cfg {Boolean} hideTabs True to hide the tab strip (defaults to false)
 
29
 * @cfg {Boolean} resizeTabs True to enable automatic tab resizing. This will resize the tabs so they are all the same size and fit within
 
30
 * the space available, similar to FireFox 1.5 tabs (defaults to false)
 
31
 * @cfg {Number} minTabWidth The minimum tab width (defaults to 40)
 
32
 * @cfg {Number} preferredTabWidth The preferred tab width (defaults to 150)
 
33
 * @cfg {Boolean} showPin True to show a pin button
 
34
* @cfg {Boolean} hidden True to start the region hidden (defaults to false)
 
35
* @cfg {Boolean} hideWhenEmpty True to hide the region when it has no panels
 
36
* @cfg {Boolean} disableTabTips True to disable tab tooltips
 
37
 */
 
38
Ext.LayoutRegion = function(mgr, config, pos){
 
39
    Ext.LayoutRegion.superclass.constructor.call(this, mgr, config, pos, true);
 
40
    var dh = Ext.DomHelper;
 
41
    /** This region's container element @type Ext.Element */
 
42
    this.el = dh.append(mgr.el.dom, {tag: "div", cls: "x-layout-panel x-layout-panel-" + this.position}, true);
 
43
    /** This region's title element @type Ext.Element */
 
44
 
 
45
    this.titleEl = dh.append(this.el.dom, {tag: "div", unselectable: "on", cls: "x-unselectable x-layout-panel-hd x-layout-title-"+this.position, children:[
 
46
        {tag: "span", cls: "x-unselectable x-layout-panel-hd-text", unselectable: "on", html: " "},
 
47
        {tag: "div", cls: "x-unselectable x-layout-panel-hd-tools", unselectable: "on"}
 
48
    ]}, true);
 
49
    this.titleEl.enableDisplayMode();
 
50
    /** This region's title text element @type HTMLElement */
 
51
    this.titleTextEl = this.titleEl.dom.firstChild;
 
52
    this.tools = Ext.get(this.titleEl.dom.childNodes[1], true);
 
53
    this.closeBtn = this.createTool(this.tools.dom, "x-layout-close");
 
54
    this.closeBtn.enableDisplayMode();
 
55
    this.closeBtn.on("click", this.closeClicked, this);
 
56
    this.closeBtn.hide();
 
57
 
 
58
    this.createBody(config);
 
59
    this.visible = true;
 
60
    this.collapsed = false;
 
61
 
 
62
    if(config.hideWhenEmpty){
 
63
        this.hide();
 
64
        this.on("paneladded", this.validateVisibility, this);
 
65
        this.on("panelremoved", this.validateVisibility, this);
 
66
    }
 
67
    this.applyConfig(config);
 
68
};
 
69
 
 
70
Ext.extend(Ext.LayoutRegion, Ext.BasicLayoutRegion, {
 
71
 
 
72
    createBody : function(){
 
73
        /** This region's body element @type Ext.Element */
 
74
        this.bodyEl = this.el.createChild({tag: "div", cls: "x-layout-panel-body"});
 
75
    },
 
76
 
 
77
    applyConfig : function(c){
 
78
        if(c.collapsible && this.position != "center" && !this.collapsedEl){
 
79
            var dh = Ext.DomHelper;
 
80
            if(c.titlebar !== false){
 
81
                this.collapseBtn = this.createTool(this.tools.dom, "x-layout-collapse-"+this.position);
 
82
                this.collapseBtn.on("click", this.collapse, this);
 
83
                this.collapseBtn.enableDisplayMode();
 
84
 
 
85
                if(c.showPin === true || this.showPin){
 
86
                    this.stickBtn = this.createTool(this.tools.dom, "x-layout-stick");
 
87
                    this.stickBtn.enableDisplayMode();
 
88
                    this.stickBtn.on("click", this.expand, this);
 
89
                    this.stickBtn.hide();
 
90
                }
 
91
            }
 
92
            /** This region's collapsed element @type Ext.Element */
 
93
            this.collapsedEl = dh.append(this.mgr.el.dom, {cls: "x-layout-collapsed x-layout-collapsed-"+this.position, children:[
 
94
                {cls: "x-layout-collapsed-tools", children:[{cls: "x-layout-ctools-inner"}]}
 
95
            ]}, true);
 
96
            if(c.floatable !== false){
 
97
               this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
 
98
               this.collapsedEl.on("click", this.collapseClick, this);
 
99
            }
 
100
 
 
101
            if(c.collapsedTitle && (this.position == "north" || this.position== "south")) {
 
102
                this.collapsedTitleTextEl = dh.append(this.collapsedEl.dom, {tag: "div", cls: "x-unselectable x-layout-panel-hd-text",
 
103
                   id: "message", unselectable: "on", style:{"float":"left"}});
 
104
               this.collapsedTitleTextEl.innerHTML = c.collapsedTitle;
 
105
             }
 
106
            this.expandBtn = this.createTool(this.collapsedEl.dom.firstChild.firstChild, "x-layout-expand-"+this.position);
 
107
            this.expandBtn.on("click", this.expand, this);
 
108
        }
 
109
        if(this.collapseBtn){
 
110
            this.collapseBtn.setVisible(c.collapsible == true);
 
111
        }
 
112
        this.cmargins = c.cmargins || this.cmargins ||
 
113
                         (this.position == "west" || this.position == "east" ?
 
114
                             {top: 0, left: 2, right:2, bottom: 0} :
 
115
                             {top: 2, left: 0, right:0, bottom: 2});
 
116
        this.margins = c.margins || this.margins || {top: 0, left: 0, right:0, bottom: 0};
 
117
        this.bottomTabs = c.tabPosition != "top";
 
118
        this.autoScroll = c.autoScroll || false;
 
119
        if(this.autoScroll){
 
120
            this.bodyEl.setStyle("overflow", "auto");
 
121
        }else{
 
122
            this.bodyEl.setStyle("overflow", "hidden");
 
123
        }
 
124
        //if(c.titlebar !== false){
 
125
            if((!c.titlebar && !c.title) || c.titlebar === false){
 
126
                this.titleEl.hide();
 
127
            }else{
 
128
                this.titleEl.show();
 
129
                if(c.title){
 
130
                    this.titleTextEl.innerHTML = c.title;
 
131
                }
 
132
            }
 
133
        //}
 
134
        this.duration = c.duration || .30;
 
135
        this.slideDuration = c.slideDuration || .45;
 
136
        this.config = c;
 
137
        if(c.collapsed){
 
138
            this.collapse(true);
 
139
        }
 
140
        if(c.hidden){
 
141
            this.hide();
 
142
        }
 
143
    },
 
144
    /**
 
145
     * Returns true if this region is currently visible.
 
146
     * @return {Boolean}
 
147
     */
 
148
    isVisible : function(){
 
149
        return this.visible;
 
150
    },
 
151
 
 
152
    /**
 
153
     * Updates the title for collapsed north/south regions (used with {@link #collapsedTitle} config option)
 
154
     * @param {String} title (optional) The title text (accepts HTML markup, defaults to the numeric character reference for a non-breaking space, " ")
 
155
     */
 
156
    setCollapsedTitle : function(title){
 
157
        title = title || " ";
 
158
        if(this.collapsedTitleTextEl){
 
159
            this.collapsedTitleTextEl.innerHTML = title;
 
160
        }
 
161
    },
 
162
 
 
163
    getBox : function(){
 
164
        var b;
 
165
        if(!this.collapsed){
 
166
            b = this.el.getBox(false, true);
 
167
        }else{
 
168
            b = this.collapsedEl.getBox(false, true);
 
169
        }
 
170
        return b;
 
171
    },
 
172
 
 
173
    getMargins : function(){
 
174
        return this.collapsed ? this.cmargins : this.margins;
 
175
    },
 
176
 
 
177
    highlight : function(){
 
178
        this.el.addClass("x-layout-panel-dragover");
 
179
    },
 
180
 
 
181
    unhighlight : function(){
 
182
        this.el.removeClass("x-layout-panel-dragover");
 
183
    },
 
184
 
 
185
    updateBox : function(box){
 
186
        this.box = box;
 
187
        if(!this.collapsed){
 
188
            this.el.dom.style.left = box.x + "px";
 
189
            this.el.dom.style.top = box.y + "px";
 
190
            this.updateBody(box.width, box.height);
 
191
        }else{
 
192
            this.collapsedEl.dom.style.left = box.x + "px";
 
193
            this.collapsedEl.dom.style.top = box.y + "px";
 
194
            this.collapsedEl.setSize(box.width, box.height);
 
195
        }
 
196
        if(this.tabs){
 
197
            this.tabs.autoSizeTabs();
 
198
        }
 
199
    },
 
200
 
 
201
    updateBody : function(w, h){
 
202
        if(w !== null){
 
203
            this.el.setWidth(w);
 
204
            w -= this.el.getBorderWidth("rl");
 
205
            if(this.config.adjustments){
 
206
                w += this.config.adjustments[0];
 
207
            }
 
208
        }
 
209
        if(h !== null){
 
210
            this.el.setHeight(h);
 
211
            h = this.titleEl && this.titleEl.isDisplayed() ? h - (this.titleEl.getHeight()||0) : h;
 
212
            h -= this.el.getBorderWidth("tb");
 
213
            if(this.config.adjustments){
 
214
                h += this.config.adjustments[1];
 
215
            }
 
216
            this.bodyEl.setHeight(h);
 
217
            if(this.tabs){
 
218
                h = this.tabs.syncHeight(h);
 
219
            }
 
220
        }
 
221
        if(this.panelSize){
 
222
            w = w !== null ? w : this.panelSize.width;
 
223
            h = h !== null ? h : this.panelSize.height;
 
224
        }
 
225
        if(this.activePanel){
 
226
            var el = this.activePanel.getEl();
 
227
            w = w !== null ? w : el.getWidth();
 
228
            h = h !== null ? h : el.getHeight();
 
229
            this.panelSize = {width: w, height: h};
 
230
            this.activePanel.setSize(w, h);
 
231
        }
 
232
        if(Ext.isIE && this.tabs){
 
233
            this.tabs.el.repaint();
 
234
        }
 
235
    },
 
236
 
 
237
    /**
 
238
     * Returns the container element for this region.
 
239
     * @return {Ext.Element}
 
240
     */
 
241
    getEl : function(){
 
242
        return this.el;
 
243
    },
 
244
 
 
245
    /**
 
246
     * Hides this region.
 
247
     */
 
248
    hide : function(){
 
249
        if(!this.collapsed){
 
250
            this.el.dom.style.left = "-2000px";
 
251
            this.el.hide();
 
252
        }else{
 
253
            this.collapsedEl.dom.style.left = "-2000px";
 
254
            this.collapsedEl.hide();
 
255
        }
 
256
        this.visible = false;
 
257
        this.fireEvent("visibilitychange", this, false);
 
258
    },
 
259
 
 
260
    /**
 
261
     * Shows this region if it was previously hidden.
 
262
     */
 
263
    show : function(){
 
264
        if(!this.collapsed){
 
265
            this.el.show();
 
266
        }else{
 
267
            this.collapsedEl.show();
 
268
        }
 
269
        this.visible = true;
 
270
        this.fireEvent("visibilitychange", this, true);
 
271
    },
 
272
 
 
273
    closeClicked : function(){
 
274
        if(this.activePanel){
 
275
            this.remove(this.activePanel);
 
276
        }
 
277
    },
 
278
 
 
279
    collapseClick : function(e){
 
280
        if(this.isSlid){
 
281
           e.stopPropagation();
 
282
           this.slideIn();
 
283
        }else{
 
284
           e.stopPropagation();
 
285
           this.slideOut();
 
286
        }
 
287
    },
 
288
 
 
289
    /**
 
290
     * Collapses this region.
 
291
     * @param {Boolean} skipAnim (optional) true to collapse the element without animation (if animate is true)
 
292
     */
 
293
    collapse : function(skipAnim){
 
294
        if(this.collapsed) return;
 
295
        this.collapsed = true;
 
296
        if(this.split){
 
297
            this.split.el.hide();
 
298
        }
 
299
        if(this.config.animate && skipAnim !== true){
 
300
            this.fireEvent("invalidated", this);
 
301
            this.animateCollapse();
 
302
        }else{
 
303
            this.el.setLocation(-20000,-20000);
 
304
            this.el.hide();
 
305
            this.collapsedEl.show();
 
306
            this.fireEvent("collapsed", this);
 
307
            this.fireEvent("invalidated", this);
 
308
        }
 
309
    },
 
310
 
 
311
    animateCollapse : function(){
 
312
        // overridden
 
313
    },
 
314
 
 
315
    /**
 
316
     * Expands this region if it was previously collapsed.
 
317
     * @param {Ext.EventObject} e The event that triggered the expand (or null if calling manually)
 
318
     * @param {Boolean} skipAnim (optional) true to expand the element without animation (if animate is true)
 
319
     */
 
320
    expand : function(e, skipAnim){
 
321
        if(e) e.stopPropagation();
 
322
        if(!this.collapsed || this.el.hasActiveFx()) return;
 
323
        if(this.isSlid){
 
324
            this.afterSlideIn();
 
325
            skipAnim = true;
 
326
        }
 
327
        this.collapsed = false;
 
328
        if(this.config.animate && skipAnim !== true){
 
329
            this.animateExpand();
 
330
        }else{
 
331
            this.el.show();
 
332
            if(this.split){
 
333
                this.split.el.show();
 
334
            }
 
335
            this.collapsedEl.setLocation(-2000,-2000);
 
336
            this.collapsedEl.hide();
 
337
            this.fireEvent("invalidated", this);
 
338
            this.fireEvent("expanded", this);
 
339
        }
 
340
    },
 
341
 
 
342
    animateExpand : function(){
 
343
        // overridden
 
344
    },
 
345
 
 
346
    initTabs : function(){
 
347
        this.bodyEl.setStyle("overflow", "hidden");
 
348
        var ts = new Ext.TabPanel(this.bodyEl.dom, {
 
349
            tabPosition: this.bottomTabs ? 'bottom' : 'top',
 
350
            disableTooltips: this.config.disableTabTips
 
351
        });
 
352
        if(this.config.hideTabs){
 
353
            ts.stripWrap.setDisplayed(false);
 
354
        }
 
355
        this.tabs = ts;
 
356
        ts.resizeTabs = this.config.resizeTabs === true;
 
357
        ts.minTabWidth = this.config.minTabWidth || 40;
 
358
        ts.maxTabWidth = this.config.maxTabWidth || 250;
 
359
        ts.preferredTabWidth = this.config.preferredTabWidth || 150;
 
360
        ts.monitorResize = false;
 
361
        ts.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden");
 
362
        ts.bodyEl.addClass('x-layout-tabs-body');
 
363
        this.panels.each(this.initPanelAsTab, this);
 
364
    },
 
365
 
 
366
    initPanelAsTab : function(panel){
 
367
        var ti = this.tabs.addTab(panel.getEl().id, panel.getTitle(), null,
 
368
                    this.config.closeOnTab && panel.isClosable());
 
369
        if(panel.tabTip !== undefined){
 
370
            ti.setTooltip(panel.tabTip);
 
371
        }
 
372
        ti.on("activate", function(){
 
373
              this.setActivePanel(panel);
 
374
        }, this);
 
375
        if(this.config.closeOnTab){
 
376
            ti.on("beforeclose", function(t, e){
 
377
                e.cancel = true;
 
378
                this.remove(panel);
 
379
            }, this);
 
380
        }
 
381
        return ti;
 
382
    },
 
383
 
 
384
    updatePanelTitle : function(panel, title){
 
385
        if(this.activePanel == panel){
 
386
            this.updateTitle(title);
 
387
        }
 
388
        if(this.tabs){
 
389
            var ti = this.tabs.getTab(panel.getEl().id);
 
390
            ti.setText(title);
 
391
            if(panel.tabTip !== undefined){
 
392
                ti.setTooltip(panel.tabTip);
 
393
            }
 
394
        }
 
395
    },
 
396
 
 
397
    updateTitle : function(title){
 
398
        if(this.titleTextEl && !this.config.title){
 
399
            this.titleTextEl.innerHTML = (typeof title != "undefined" && title.length > 0 ? title : " ");
 
400
        }
 
401
    },
 
402
 
 
403
    setActivePanel : function(panel){
 
404
        panel = this.getPanel(panel);
 
405
        if(this.activePanel && this.activePanel != panel){
 
406
            this.activePanel.setActiveState(false);
 
407
        }
 
408
        this.activePanel = panel;
 
409
        panel.setActiveState(true);
 
410
        if(this.panelSize){
 
411
            panel.setSize(this.panelSize.width, this.panelSize.height);
 
412
        }
 
413
        if(this.closeBtn){
 
414
            this.closeBtn.setVisible(!this.config.closeOnTab && !this.isSlid && panel.isClosable());
 
415
        }
 
416
        this.updateTitle(panel.getTitle());
 
417
        if(this.tabs){
 
418
            this.fireEvent("invalidated", this);
 
419
        }
 
420
        this.fireEvent("panelactivated", this, panel);
 
421
    },
 
422
 
 
423
    /**
 
424
     * Shows the specified panel.
 
425
     * @param {Number/String/ContentPanel} panelId The panel's index, id or the panel itself
 
426
     * @return {Ext.ContentPanel} The shown panel, or null if a panel could not be found from panelId
 
427
     */
 
428
    showPanel : function(panel){
 
429
        if(panel = this.getPanel(panel)){
 
430
            if(this.tabs){
 
431
                var tab = this.tabs.getTab(panel.getEl().id);
 
432
                if(tab.isHidden()){
 
433
                    this.tabs.unhideTab(tab.id);
 
434
                }
 
435
                tab.activate();
 
436
            }else{
 
437
                this.setActivePanel(panel);
 
438
            }
 
439
        }
 
440
        return panel;
 
441
    },
 
442
 
 
443
    /**
 
444
     * Get the active panel for this region.
 
445
     * @return {Ext.ContentPanel} The active panel or null
 
446
     */
 
447
    getActivePanel : function(){
 
448
        return this.activePanel;
 
449
    },
 
450
 
 
451
    validateVisibility : function(){
 
452
        if(this.panels.getCount() < 1){
 
453
            this.updateTitle("&#160;");
 
454
            this.closeBtn.hide();
 
455
            this.hide();
 
456
        }else{
 
457
            if(!this.isVisible()){
 
458
                this.show();
 
459
            }
 
460
        }
 
461
    },
 
462
 
 
463
    /**
 
464
     * Adds the passed ContentPanel(s) to this region.
 
465
     * @param {ContentPanel...} panel The ContentPanel(s) to add (you can pass more than one)
 
466
     * @return {Ext.ContentPanel} The panel added (if only one was added; null otherwise)
 
467
     */
 
468
    add : function(panel){
 
469
        if(arguments.length > 1){
 
470
            for(var i = 0, len = arguments.length; i < len; i++) {
 
471
                this.add(arguments[i]);
 
472
            }
 
473
            return null;
 
474
        }
 
475
        if(this.hasPanel(panel)){
 
476
            this.showPanel(panel);
 
477
            return panel;
 
478
        }
 
479
        panel.setRegion(this);
 
480
        this.panels.add(panel);
 
481
        if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
 
482
            this.bodyEl.dom.appendChild(panel.getEl().dom);
 
483
            if(panel.background !== true){
 
484
                this.setActivePanel(panel);
 
485
            }
 
486
            this.fireEvent("paneladded", this, panel);
 
487
            return panel;
 
488
        }
 
489
        if(!this.tabs){
 
490
            this.initTabs();
 
491
        }else{
 
492
            this.initPanelAsTab(panel);
 
493
        }
 
494
        if(panel.background !== true){
 
495
            this.tabs.activate(panel.getEl().id);
 
496
        }
 
497
        this.fireEvent("paneladded", this, panel);
 
498
        return panel;
 
499
    },
 
500
 
 
501
    /**
 
502
     * Hides the tab for the specified panel.
 
503
     * @param {Number/String/ContentPanel} panel The panel's index, id or the panel itself
 
504
     */
 
505
    hidePanel : function(panel){
 
506
        if(this.tabs && (panel = this.getPanel(panel))){
 
507
            this.tabs.hideTab(panel.getEl().id);
 
508
        }
 
509
    },
 
510
 
 
511
    /**
 
512
     * Unhides the tab for a previously hidden panel.
 
513
     * @param {Number/String/ContentPanel} panel The panel's index, id or the panel itself
 
514
     */
 
515
    unhidePanel : function(panel){
 
516
        if(this.tabs && (panel = this.getPanel(panel))){
 
517
            this.tabs.unhideTab(panel.getEl().id);
 
518
        }
 
519
    },
 
520
 
 
521
    clearPanels : function(){
 
522
        while(this.panels.getCount() > 0){
 
523
             this.remove(this.panels.first());
 
524
        }
 
525
    },
 
526
 
 
527
    /**
 
528
     * Removes the specified panel. If preservePanel is not true (either here or in the config), the panel is destroyed.
 
529
     * @param {Number/String/ContentPanel} panel The panel's index, id or the panel itself
 
530
     * @param {Boolean} preservePanel Overrides the config preservePanel option
 
531
     * @return {Ext.ContentPanel} The panel that was removed
 
532
     */
 
533
    remove : function(panel, preservePanel){
 
534
        panel = this.getPanel(panel);
 
535
        if(!panel){
 
536
            return null;
 
537
        }
 
538
        var e = {};
 
539
        this.fireEvent("beforeremove", this, panel, e);
 
540
        if(e.cancel === true){
 
541
            return null;
 
542
        }
 
543
        preservePanel = (typeof preservePanel != "undefined" ? preservePanel : (this.config.preservePanels === true || panel.preserve === true));
 
544
        var panelId = panel.getId();
 
545
        this.panels.removeKey(panelId);
 
546
        if(preservePanel){
 
547
            document.body.appendChild(panel.getEl().dom);
 
548
        }
 
549
        if(this.tabs){
 
550
            this.tabs.removeTab(panel.getEl().id);
 
551
        }else if (!preservePanel){
 
552
            this.bodyEl.dom.removeChild(panel.getEl().dom);
 
553
        }
 
554
        if(this.panels.getCount() == 1 && this.tabs && !this.config.alwaysShowTabs){
 
555
            var p = this.panels.first();
 
556
            var tempEl = document.createElement("div"); // temp holder to keep IE from deleting the node
 
557
            tempEl.appendChild(p.getEl().dom);
 
558
            this.bodyEl.update("");
 
559
            this.bodyEl.dom.appendChild(p.getEl().dom);
 
560
            tempEl = null;
 
561
            this.updateTitle(p.getTitle());
 
562
            this.tabs = null;
 
563
            this.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden");
 
564
            this.setActivePanel(p);
 
565
        }
 
566
        panel.setRegion(null);
 
567
        if(this.activePanel == panel){
 
568
            this.activePanel = null;
 
569
        }
 
570
        if(this.config.autoDestroy !== false && preservePanel !== true){
 
571
            try{panel.destroy();}catch(e){}
 
572
        }
 
573
        this.fireEvent("panelremoved", this, panel);
 
574
        return panel;
 
575
    },
 
576
 
 
577
    /**
 
578
     * Returns the TabPanel component used by this region
 
579
     * @return {Ext.TabPanel}
 
580
     */
 
581
    getTabs : function(){
 
582
        return this.tabs;
 
583
    },
 
584
 
 
585
    createTool : function(parentEl, className){
 
586
        var btn = Ext.DomHelper.append(parentEl, {tag: "div", cls: "x-layout-tools-button",
 
587
            children: [{tag: "div", cls: "x-layout-tools-button-inner " + className, html: "&#160;"}]}, true);
 
588
        btn.addClassOnOver("x-layout-tools-button-over");
 
589
        return btn;
 
590
    }
 
591
});
 
 
b'\\ No newline at end of file'