⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 borderlayout.js

📁 Ext JS是一个创建丰富互联网应用程序的跨浏览器的JavaScrip库。它包含:高效率
💻 JS
📖 第 1 页 / 共 3 页
字号:
    /**     * @cfg {Number} minWidth     * <p>The minimum allowable width in pixels for this region (defaults to <tt>50</tt>).     * <tt>maxWidth</tt> may also be specified.</p><br>     * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> /      * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified      * <tt>minWidth</tt> / <tt>maxWidth</tt>.</p>     */    minWidth:50,    /**     * @cfg {Number} minHeight     * The minimum allowable height in pixels for this region (defaults to <tt>50</tt>)     * <tt>maxHeight</tt> may also be specified.</p><br>     * <p><b>Note</b>: setting the <tt>{@link Ext.SplitBar#minSize minSize}</tt> /      * <tt>{@link Ext.SplitBar#maxSize maxSize}</tt> supersedes any specified      * <tt>minHeight</tt> / <tt>maxHeight</tt>.</p>     */    minHeight:50,    // private    defaultMargins : {left:0,top:0,right:0,bottom:0},    // private    defaultNSCMargins : {left:5,top:5,right:5,bottom:5},    // private    defaultEWCMargins : {left:5,top:0,right:5,bottom:0},    floatingZIndex: 100,    /**     * True if this region is collapsed. Read-only.     * @type Boolean     * @property     */    isCollapsed : false,    /**     * This region's panel.  Read-only.     * @type Ext.Panel     * @property panel     */    /**     * This region's layout.  Read-only.     * @type Layout     * @property layout     */    /**     * This region's layout position (north, south, east, west or center).  Read-only.     * @type String     * @property position     */    // private    render : function(ct, p){        this.panel = p;        p.el.enableDisplayMode();        this.targetEl = ct;        this.el = p.el;        var gs = p.getState, ps = this.position;        p.getState = function(){            return Ext.apply(gs.call(p) || {}, this.state);        }.createDelegate(this);        if(ps != 'center'){            p.allowQueuedExpand = false;            p.on({                beforecollapse: this.beforeCollapse,                collapse: this.onCollapse,                beforeexpand: this.beforeExpand,                expand: this.onExpand,                hide: this.onHide,                show: this.onShow,                scope: this            });            if(this.collapsible || this.floatable){                p.collapseEl = 'el';                p.slideAnchor = this.getSlideAnchor();            }            if(p.tools && p.tools.toggle){                p.tools.toggle.addClass('x-tool-collapse-'+ps);                p.tools.toggle.addClassOnOver('x-tool-collapse-'+ps+'-over');            }        }    },    // private    getCollapsedEl : function(){        if(!this.collapsedEl){            if(!this.toolTemplate){                var tt = new Ext.Template(                     '<div class="x-tool x-tool-{id}">&#160;</div>'                );                tt.disableFormats = true;                tt.compile();                Ext.layout.BorderLayout.Region.prototype.toolTemplate = tt;            }            this.collapsedEl = this.targetEl.createChild({                cls: "x-layout-collapsed x-layout-collapsed-"+this.position,                id: this.panel.id + '-xcollapsed'            });            this.collapsedEl.enableDisplayMode('block');            if(this.collapseMode == 'mini'){                this.collapsedEl.addClass('x-layout-cmini-'+this.position);                this.miniCollapsedEl = this.collapsedEl.createChild({                    cls: "x-layout-mini x-layout-mini-"+this.position, html: "&#160;"                });                this.miniCollapsedEl.addClassOnOver('x-layout-mini-over');                this.collapsedEl.addClassOnOver("x-layout-collapsed-over");                this.collapsedEl.on('click', this.onExpandClick, this, {stopEvent:true});            }else {                if(this.collapsible !== false && !this.hideCollapseTool) {                    var t = this.toolTemplate.append(                            this.collapsedEl.dom,                            {id:'expand-'+this.position}, true);                    t.addClassOnOver('x-tool-expand-'+this.position+'-over');                    t.on('click', this.onExpandClick, this, {stopEvent:true});                }                if(this.floatable !== false || this.titleCollapse){                   this.collapsedEl.addClassOnOver("x-layout-collapsed-over");                   this.collapsedEl.on("click", this[this.floatable ? 'collapseClick' : 'onExpandClick'], this);                }            }        }        return this.collapsedEl;    },    // private    onExpandClick : function(e){        if(this.isSlid){            this.afterSlideIn();            this.panel.expand(false);        }else{            this.panel.expand();        }    },    // private    onCollapseClick : function(e){        this.panel.collapse();    },    // private    beforeCollapse : function(p, animate){        this.lastAnim = animate;        if(this.splitEl){            this.splitEl.hide();        }        this.getCollapsedEl().show();        this.panel.el.setStyle('z-index', 100);        this.isCollapsed = true;        this.layout.layout();    },    // private    onCollapse : function(animate){        this.panel.el.setStyle('z-index', 1);        if(this.lastAnim === false || this.panel.animCollapse === false){            this.getCollapsedEl().dom.style.visibility = 'visible';        }else{            this.getCollapsedEl().slideIn(this.panel.slideAnchor, {duration:.2});        }        this.state.collapsed = true;        this.panel.saveState();    },    // private    beforeExpand : function(animate){        var c = this.getCollapsedEl();        this.el.show();        if(this.position == 'east' || this.position == 'west'){            this.panel.setSize(undefined, c.getHeight());        }else{            this.panel.setSize(c.getWidth(), undefined);        }        c.hide();        c.dom.style.visibility = 'hidden';        this.panel.el.setStyle('z-index', this.floatingZIndex);    },    // private    onExpand : function(){        this.isCollapsed = false;        if(this.splitEl){            this.splitEl.show();        }        this.layout.layout();        this.panel.el.setStyle('z-index', 1);        this.state.collapsed = false;        this.panel.saveState();    },    // private    collapseClick : function(e){        if(this.isSlid){           e.stopPropagation();           this.slideIn();        }else{           e.stopPropagation();           this.slideOut();        }    },    // private    onHide : function(){        if(this.isCollapsed){            this.getCollapsedEl().hide();        }else if(this.splitEl){            this.splitEl.hide();        }    },    // private    onShow : function(){        if(this.isCollapsed){            this.getCollapsedEl().show();        }else if(this.splitEl){            this.splitEl.show();        }    },    /**     * True if this region is currently visible, else false.     * @return {Boolean}     */    isVisible : function(){        return !this.panel.hidden;    },    /**     * Returns the current margins for this region.  If the region is collapsed, the     * {@link #cmargins} (collapsed margins) value will be returned, otherwise the     * {@link #margins} value will be returned.     * @return {Object} An object containing the element's margins: <tt>{left: (left     * margin), top: (top margin), right: (right margin), bottom: (bottom margin)}</tt>     */    getMargins : function(){        return this.isCollapsed && this.cmargins ? this.cmargins : this.margins;    },    /**     * Returns the current size of this region.  If the region is collapsed, the size of the     * collapsedEl will be returned, otherwise the size of the region's panel will be returned.     * @return {Object} An object containing the element's size: <tt>{width: (element width),     * height: (element height)}</tt>     */    getSize : function(){        return this.isCollapsed ? this.getCollapsedEl().getSize() : this.panel.getSize();    },    /**     * Sets the specified panel as the container element for this region.     * @param {Ext.Panel} panel The new panel     */    setPanel : function(panel){        this.panel = panel;    },    /**     * Returns the minimum allowable width for this region.     * @return {Number} The minimum width     */    getMinWidth: function(){        return this.minWidth;    },    /**     * Returns the minimum allowable height for this region.     * @return {Number} The minimum height     */    getMinHeight: function(){        return this.minHeight;    },    // private    applyLayoutCollapsed : function(box){        var ce = this.getCollapsedEl();        ce.setLeftTop(box.x, box.y);        ce.setSize(box.width, box.height);    },    // private    applyLayout : function(box){        if(this.isCollapsed){            this.applyLayoutCollapsed(box);        }else{            this.panel.setPosition(box.x, box.y);            this.panel.setSize(box.width, box.height);        }    },    // private    beforeSlide: function(){        this.panel.beforeEffect();    },    // private    afterSlide : function(){        this.panel.afterEffect();    },    // private    initAutoHide : function(){        if(this.autoHide !== false){            if(!this.autoHideHd){                var st = new Ext.util.DelayedTask(this.slideIn, this);                this.autoHideHd = {                    "mouseout": function(e){                        if(!e.within(this.el, true)){                            st.delay(500);                        }                    },                    "mouseover" : function(e){                        st.cancel();                    },                    scope : this                };            }            this.el.on(this.autoHideHd);        }    },    // private    clearAutoHide : function(){        if(this.autoHide !== false){            this.el.un("mouseout", this.autoHideHd.mouseout);            this.el.un("mouseover", this.autoHideHd.mouseover);        }    },    // private    clearMonitor : function(){        Ext.getDoc().un("click", this.slideInIf, this);    },    // these names are backwards but not changed for compat    // private    slideOut : function(){        if(this.isSlid || this.el.hasActiveFx()){            return;        }        this.isSlid = true;        var ts = this.panel.tools;        if(ts && ts.toggle){            ts.toggle.hide();        }        this.el.show();        if(this.position == 'east' || this.position == 'west'){            this.panel.setSize(undefined, this.collapsedEl.getHeight());        }else{            this.panel.setSize(this.collapsedEl.getWidth(), undefined);        }        this.restoreLT = [this.el.dom.style.left, this.el.dom.style.top];        this.el.alignTo(this.collapsedEl, this.getCollapseAnchor());        this.el.setStyle("z-index", this.floatingZIndex+2);        this.panel.el.replaceClass('x-panel-collapsed', 'x-panel-floating');        if(this.animFloat !== false){            this.beforeSlide();            this.el.slideIn(this.getSlideAnchor(), {                callback: function(){                    this.afterSlide();                    this.initAutoHide();                    Ext.getDoc().on("click", this.slideInIf, this);                },                scope: this,                block: true            });        }else{            this.initAutoHide();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -