a:63:{s:9:"#provides";s:27:"dijit.layout.SplitContainer";s:9:"#resource";s:24:"layout/SplitContainer.js";s:9:"#requires";a:2:{i:0;a:3:{i:0;s:6:"common";i:1;s:11:"dojo.cookie";i:2;s:4:"dojo";}i:1;a:2:{i:0;s:6:"common";i:1;s:26:"dijit.layout._LayoutWidget";}}s:27:"dijit.layout.SplitContainer";a:6:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:26:"dijit.layout._LayoutWidget";}s:4:"call";a:1:{i:0;s:26:"dijit.layout._LayoutWidget";}}s:7:"summary";s:56:"Deprecated. Use `dijit.layout.BorderContainer` instead.";s:11:"description";s:376:"A Container widget with sizing handles in-between each child. Contains multiple children widgets, all of which are displayed side by side (either horizontally or vertically); there's a bar between each of the children, and you can adjust the relative size of each child by dragging the bars. You must specify a size (width and height) for the SplitContainer. tags: deprecated";s:6:"source";s:113:" dojo.deprecated("dijit.layout.SplitContainer is deprecated", "use BorderContainer with splitter instead", 2.0);";s:9:"classlike";b:1;}s:40:"dijit.layout.SplitContainer.activeSizing";a:3:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:7:"Boolean";s:7:"summary";s:128:"If true, the children's size changes as you drag the bar; otherwise, the sizes don't change until you drop the bar (by mouse-up)";}s:38:"dijit.layout.SplitContainer.sizerWidth";a:4:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:8:"instance";s:27:"dijit.layout.SplitContainer";s:4:"type";s:7:"Integer";s:7:"summary";s:44:"Size in pixels of the bar between each child";}s:39:"dijit.layout.SplitContainer.orientation";a:3:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:6:"String";s:7:"summary";s:101:"either 'horizontal' or vertical; indicates whether the children are arranged side-by-side or up/down.";}s:35:"dijit.layout.SplitContainer.persist";a:3:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:7:"Boolean";s:7:"summary";s:35:"Save splitter positions in a cookie";}s:37:"dijit.layout.SplitContainer.baseClass";a:2:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:47:"dijit.layout.SplitContainer.postMixInProperties";a:4:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:108:" this.inherited("postMixInProperties",arguments); this.isHorizontal = (this.orientation == 'horizontal');";s:7:"summary";s:0:"";}s:38:"dijit.layout.SplitContainer.postCreate";a:4:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:1363:" this.inherited(arguments); this.sizers = []; // overflow has to be explicitly hidden for splitContainers using gekko (trac #1435) // to keep other combined css classes from inadvertantly making the overflow visible if(dojo.isMozilla){ this.domNode.style.overflow = '-moz-scrollbars-none'; // hidden doesn't work } // create the fake dragger if(typeof this.sizerWidth == "object"){ try{ //FIXME: do this without a try/catch this.sizerWidth = parseInt(this.sizerWidth.toString()); }catch(e){ this.sizerWidth = 7; } } var sizer = dojo.doc.createElement('div'); this.virtualSizer = sizer; sizer.style.position = 'relative'; // #1681: work around the dreaded 'quirky percentages in IE' layout bug // If the splitcontainer's dimensions are specified in percentages, it // will be resized when the virtualsizer is displayed in _showSizingLine // (typically expanding its bounds unnecessarily). This happens because // we use position: relative for .dijitSplitContainer. // The workaround: instead of changing the display style attribute, // switch to changing the zIndex (bring to front/move to back) sizer.style.zIndex = 10; sizer.className = this.isHorizontal ? 'dijitSplitContainerVirtualSizerH' : 'dijitSplitContainerVirtualSizerV'; this.domNode.appendChild(sizer); dojo.setSelectable(sizer, false);";s:7:"summary";s:0:"";}s:35:"dijit.layout.SplitContainer.destroy";a:4:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:108:" delete this.virtualSizer; dojo.forEach(this._ownconnects, dojo.disconnect); this.inherited(arguments);";s:7:"summary";s:0:"";}s:35:"dijit.layout.SplitContainer.startup";a:4:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:329:" if(this._started){ return; } dojo.forEach(this.getChildren(), function(child, i, children){ // attach the children and create the draggers this._setupChild(child); if(i < children.length-1){ this._addSizer(); } }, this); if(this.persist){ this._restoreState(); } this.inherited(arguments); ";s:7:"summary";s:0:"";}s:39:"dijit.layout.SplitContainer._setupChild";a:6:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"child";a:1:{s:4:"type";s:6:"Widget";}}s:6:"source";s:123:" this.inherited(arguments); child.domNode.style.position = "absolute"; dojo.addClass(child.domNode, "dijitSplitPane");";s:7:"private";b:1;s:7:"summary";s:0:"";}s:45:"dijit.layout.SplitContainer._onSizerMouseDown";a:6:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:188:" if(e.target.id){ for(var i=0;i 1){ this._addSizer(insertIndex); } // and then reposition (ie, shrink) every pane to make room for the new guy this.layout(); }";s:7:"summary";s:35:"Add a child widget to the container";}s:34:"dijit.layout.SplitContainer.layout";a:4:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:7886:"dojo.provide("dijit.layout.SplitContainer"); // // FIXME: make it prettier // FIXME: active dragging upwards doesn't always shift other bars (direction calculation is wrong in this case) // dojo.require("dojo.cookie"); dojo.require("dijit.layout._LayoutWidget"); dojo.declare("dijit.layout.SplitContainer", dijit.layout._LayoutWidget, { // summary: // Deprecated. Use `dijit.layout.BorderContainer` instead. // description: // A Container widget with sizing handles in-between each child. // Contains multiple children widgets, all of which are displayed side by side // (either horizontally or vertically); there's a bar between each of the children, // and you can adjust the relative size of each child by dragging the bars. // // You must specify a size (width and height) for the SplitContainer. // tags: // deprecated constructor: function(){ dojo.deprecated("dijit.layout.SplitContainer is deprecated", "use BorderContainer with splitter instead", 2.0); }, // activeSizing: Boolean // If true, the children's size changes as you drag the bar; // otherwise, the sizes don't change until you drop the bar (by mouse-up) activeSizing: false, // sizerWidth: Integer // Size in pixels of the bar between each child sizerWidth: 7, // FIXME: this should be a CSS attribute (at 7 because css wants it to be 7 until we fix to css) // orientation: String // either 'horizontal' or vertical; indicates whether the children are // arranged side-by-side or up/down. orientation: 'horizontal', // persist: Boolean // Save splitter positions in a cookie persist: true, baseClass: "dijitSplitContainer", postMixInProperties: function(){ this.inherited("postMixInProperties",arguments); this.isHorizontal = (this.orientation == 'horizontal'); }, postCreate: function(){ this.inherited(arguments); this.sizers = []; // overflow has to be explicitly hidden for splitContainers using gekko (trac #1435) // to keep other combined css classes from inadvertantly making the overflow visible if(dojo.isMozilla){ this.domNode.style.overflow = '-moz-scrollbars-none'; // hidden doesn't work } // create the fake dragger if(typeof this.sizerWidth == "object"){ try{ //FIXME: do this without a try/catch this.sizerWidth = parseInt(this.sizerWidth.toString()); }catch(e){ this.sizerWidth = 7; } } var sizer = dojo.doc.createElement('div'); this.virtualSizer = sizer; sizer.style.position = 'relative'; // #1681: work around the dreaded 'quirky percentages in IE' layout bug // If the splitcontainer's dimensions are specified in percentages, it // will be resized when the virtualsizer is displayed in _showSizingLine // (typically expanding its bounds unnecessarily). This happens because // we use position: relative for .dijitSplitContainer. // The workaround: instead of changing the display style attribute, // switch to changing the zIndex (bring to front/move to back) sizer.style.zIndex = 10; sizer.className = this.isHorizontal ? 'dijitSplitContainerVirtualSizerH' : 'dijitSplitContainerVirtualSizerV'; this.domNode.appendChild(sizer); dojo.setSelectable(sizer, false); }, destroy: function(){ delete this.virtualSizer; dojo.forEach(this._ownconnects, dojo.disconnect); this.inherited(arguments); }, startup: function(){ if(this._started){ return; } dojo.forEach(this.getChildren(), function(child, i, children){ // attach the children and create the draggers this._setupChild(child); if(i < children.length-1){ this._addSizer(); } }, this); if(this.persist){ this._restoreState(); } this.inherited(arguments); }, _setupChild: function(/*Widget*/ child){ this.inherited(arguments); child.domNode.style.position = "absolute"; dojo.addClass(child.domNode, "dijitSplitPane"); }, _onSizerMouseDown: function(e){ if(e.target.id){ for(var i=0;i 1){ this._addSizer(insertIndex); } // and then reposition (ie, shrink) every pane to make room for the new guy this.layout(); } }, layout: function(){ // summary: // Do layout of panels // base class defines this._contentBox on initial creation and also // on resize this.paneWidth = this._contentBox.w; this.paneHeight = this._contentBox.h; var children = this.getChildren(); if(!children.length){ return; } // // calculate space // var space = this.isHorizontal ? this.paneWidth : this.paneHeight; if(children.length > 1){ space -= this.sizerWidth * (children.length - 1); } // // calculate total of SizeShare values // var outOf = 0; dojo.forEach(children, function(child){ outOf += child.sizeShare; }); // // work out actual pixels per sizeshare unit // var pixPerUnit = space / outOf; // // set the SizeActual member of each pane // var totalSize = 0; dojo.forEach(children.slice(0, children.length - 1), function(child){ var size = Math.round(pixPerUnit * child.sizeShare); child.sizeActual = size; totalSize += size; }); children[children.length-1].sizeActual = space - totalSize; // // make sure the sizes are ok // this._checkSizes(); // // now loop, positioning each pane and letting children resize themselves // var pos = 0; var size = children[0].sizeActual; this._movePanel(children[0], pos, size); children[0].position = pos; pos += size; // if we don't have any sizers, our layout method hasn't been called yet // so bail until we are called..TODO: REVISIT: need to change the startup // algorithm to guaranteed the ordering of calls to layout method if(!this.sizers){ return; } dojo.some(children.slice(1), function(child, i){ // error-checking if(!this.sizers[i]){ return true; } // first we position the sizing handle before this pane this._moveSlider(this.sizers[i], pos, this.sizerWidth); this.sizers[i].position = pos; pos += this.sizerWidth; size = child.sizeActual; this._movePanel(child, pos, size); child.position = pos; pos += size; }, this);";s:7:"summary";s:0:"";}s:38:"dijit.layout.SplitContainer._movePanel";a:6:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:5:"panel";a:1:{s:4:"type";s:0:"";}s:3:"pos";a:1:{s:4:"type";s:0:"";}s:4:"size";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:620:" if(this.isHorizontal){ panel.domNode.style.left = pos + 'px'; // TODO: resize() takes l and t parameters too, don't need to set manually panel.domNode.style.top = 0; var box = {w: size, h: this.paneHeight}; if(panel.resize){ panel.resize(box); }else{ dojo.marginBox(panel.domNode, box); } }else{ panel.domNode.style.left = 0; // TODO: resize() takes l and t parameters too, don't need to set manually panel.domNode.style.top = pos + 'px'; var box = {w: this.paneWidth, h: size}; if(panel.resize){ panel.resize(box); }else{ dojo.marginBox(panel.domNode, box); } }";s:7:"private";b:1;s:7:"summary";s:0:"";}s:39:"dijit.layout.SplitContainer._moveSlider";a:6:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:6:"slider";a:1:{s:4:"type";s:0:"";}s:3:"pos";a:1:{s:4:"type";s:0:"";}s:4:"size";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:276:" if(this.isHorizontal){ slider.style.left = pos + 'px'; slider.style.top = 0; dojo.marginBox(slider, { w: size, h: this.paneHeight }); }else{ slider.style.left = 0; slider.style.top = pos + 'px'; dojo.marginBox(slider, { w: this.paneWidth, h: size }); }";s:7:"private";b:1;s:7:"summary";s:0:"";}s:37:"dijit.layout.SplitContainer._growPane";a:6:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:6:"growth";a:1:{s:4:"type";s:0:"";}s:4:"pane";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:389:" if(growth > 0){ if(pane.sizeActual > pane.sizeMin){ if((pane.sizeActual - pane.sizeMin) > growth){ // stick all the growth in this pane pane.sizeActual = pane.sizeActual - growth; growth = 0; }else{ // put as much growth in here as we can growth -= pane.sizeActual - pane.sizeMin; pane.sizeActual = pane.sizeMin; } } } return growth;";s:7:"private";b:1;s:7:"summary";s:0:"";}s:39:"dijit.layout.SplitContainer._checkSizes";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:852:" var totalMinSize = 0; var totalSize = 0; var children = this.getChildren(); dojo.forEach(children, function(child){ totalSize += child.sizeActual; totalMinSize += child.sizeMin; }); // only make adjustments if we have enough space for all the minimums if(totalMinSize <= totalSize){ var growth = 0; dojo.forEach(children, function(child){ if(child.sizeActual < child.sizeMin){ growth += child.sizeMin - child.sizeActual; child.sizeActual = child.sizeMin; } }); if(growth > 0){ var list = this.isDraggingLeft ? children.reverse() : children; dojo.forEach(list, function(child){ growth = this._growPane(growth, child); }, this); } }else{ dojo.forEach(children, function(child){ child.sizeActual = Math.round(totalSize * (child.sizeMin / totalMinSize)); }); }";s:7:"private";b:1;s:7:"summary";s:0:"";}s:39:"dijit.layout.SplitContainer.beginSizing";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:1:"e";a:1:{s:4:"type";s:0:"";}s:1:"i";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:1474:" var children = this.getChildren(); this.paneBefore = children[i]; this.paneAfter = children[i+1]; this.isSizing = true; this.sizingSplitter = this.sizers[i]; if(!this.cover){ this.cover = dojo.create('div', { style: { position:'absolute', zIndex:5, top: 0, left: 0, width: "100%", height: "100%" } }, this.domNode); }else{ this.cover.style.zIndex = 5; } this.sizingSplitter.style.zIndex = 6; // TODO: REVISIT - we want MARGIN_BOX and core hasn't exposed that yet (but can't we use it anyway if we pay attention? we do elsewhere.) this.originPos = dojo.coords(children[0].domNode, true); if(this.isHorizontal){ var client = e.layerX || e.offsetX || 0; var screen = e.pageX; this.originPos = this.originPos.x; }else{ var client = e.layerY || e.offsetY || 0; var screen = e.pageY; this.originPos = this.originPos.y; } this.startPoint = this.lastPoint = screen; this.screenToClientOffset = screen - client; this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position; if(!this.activeSizing){ this._showSizingLine(); } // // attach mouse events // this._ownconnects = []; this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmousemove", this, "changeSizing")); this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmouseup", this, "endSizing")); dojo.stopEvent(e);";s:7:"summary";s:0:"";}s:40:"dijit.layout.SplitContainer.changeSizing";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:218:" if(!this.isSizing){ return; } this.lastPoint = this.isHorizontal ? e.pageX : e.pageY; this.movePoint(); if(this.activeSizing){ this._updateSize(); }else{ this._moveSizingLine(); } dojo.stopEvent(e);";s:7:"summary";s:0:"";}s:37:"dijit.layout.SplitContainer.endSizing";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"e";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:300:" if(!this.isSizing){ return; } if(this.cover){ this.cover.style.zIndex = -1; } if(!this.activeSizing){ this._hideSizingLine(); } this._updateSize(); this.isSizing = false; if(this.persist){ this._saveState(this); } dojo.forEach(this._ownconnects,dojo.disconnect); ";s:7:"summary";s:0:"";}s:37:"dijit.layout.SplitContainer.movePoint";a:4:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:12580:"dojo.provide("dijit.layout.SplitContainer"); // // FIXME: make it prettier // FIXME: active dragging upwards doesn't always shift other bars (direction calculation is wrong in this case) // dojo.require("dojo.cookie"); dojo.require("dijit.layout._LayoutWidget"); dojo.declare("dijit.layout.SplitContainer", dijit.layout._LayoutWidget, { // summary: // Deprecated. Use `dijit.layout.BorderContainer` instead. // description: // A Container widget with sizing handles in-between each child. // Contains multiple children widgets, all of which are displayed side by side // (either horizontally or vertically); there's a bar between each of the children, // and you can adjust the relative size of each child by dragging the bars. // // You must specify a size (width and height) for the SplitContainer. // tags: // deprecated constructor: function(){ dojo.deprecated("dijit.layout.SplitContainer is deprecated", "use BorderContainer with splitter instead", 2.0); }, // activeSizing: Boolean // If true, the children's size changes as you drag the bar; // otherwise, the sizes don't change until you drop the bar (by mouse-up) activeSizing: false, // sizerWidth: Integer // Size in pixels of the bar between each child sizerWidth: 7, // FIXME: this should be a CSS attribute (at 7 because css wants it to be 7 until we fix to css) // orientation: String // either 'horizontal' or vertical; indicates whether the children are // arranged side-by-side or up/down. orientation: 'horizontal', // persist: Boolean // Save splitter positions in a cookie persist: true, baseClass: "dijitSplitContainer", postMixInProperties: function(){ this.inherited("postMixInProperties",arguments); this.isHorizontal = (this.orientation == 'horizontal'); }, postCreate: function(){ this.inherited(arguments); this.sizers = []; // overflow has to be explicitly hidden for splitContainers using gekko (trac #1435) // to keep other combined css classes from inadvertantly making the overflow visible if(dojo.isMozilla){ this.domNode.style.overflow = '-moz-scrollbars-none'; // hidden doesn't work } // create the fake dragger if(typeof this.sizerWidth == "object"){ try{ //FIXME: do this without a try/catch this.sizerWidth = parseInt(this.sizerWidth.toString()); }catch(e){ this.sizerWidth = 7; } } var sizer = dojo.doc.createElement('div'); this.virtualSizer = sizer; sizer.style.position = 'relative'; // #1681: work around the dreaded 'quirky percentages in IE' layout bug // If the splitcontainer's dimensions are specified in percentages, it // will be resized when the virtualsizer is displayed in _showSizingLine // (typically expanding its bounds unnecessarily). This happens because // we use position: relative for .dijitSplitContainer. // The workaround: instead of changing the display style attribute, // switch to changing the zIndex (bring to front/move to back) sizer.style.zIndex = 10; sizer.className = this.isHorizontal ? 'dijitSplitContainerVirtualSizerH' : 'dijitSplitContainerVirtualSizerV'; this.domNode.appendChild(sizer); dojo.setSelectable(sizer, false); }, destroy: function(){ delete this.virtualSizer; dojo.forEach(this._ownconnects, dojo.disconnect); this.inherited(arguments); }, startup: function(){ if(this._started){ return; } dojo.forEach(this.getChildren(), function(child, i, children){ // attach the children and create the draggers this._setupChild(child); if(i < children.length-1){ this._addSizer(); } }, this); if(this.persist){ this._restoreState(); } this.inherited(arguments); }, _setupChild: function(/*Widget*/ child){ this.inherited(arguments); child.domNode.style.position = "absolute"; dojo.addClass(child.domNode, "dijitSplitPane"); }, _onSizerMouseDown: function(e){ if(e.target.id){ for(var i=0;i 1){ this._addSizer(insertIndex); } // and then reposition (ie, shrink) every pane to make room for the new guy this.layout(); } }, layout: function(){ // summary: // Do layout of panels // base class defines this._contentBox on initial creation and also // on resize this.paneWidth = this._contentBox.w; this.paneHeight = this._contentBox.h; var children = this.getChildren(); if(!children.length){ return; } // // calculate space // var space = this.isHorizontal ? this.paneWidth : this.paneHeight; if(children.length > 1){ space -= this.sizerWidth * (children.length - 1); } // // calculate total of SizeShare values // var outOf = 0; dojo.forEach(children, function(child){ outOf += child.sizeShare; }); // // work out actual pixels per sizeshare unit // var pixPerUnit = space / outOf; // // set the SizeActual member of each pane // var totalSize = 0; dojo.forEach(children.slice(0, children.length - 1), function(child){ var size = Math.round(pixPerUnit * child.sizeShare); child.sizeActual = size; totalSize += size; }); children[children.length-1].sizeActual = space - totalSize; // // make sure the sizes are ok // this._checkSizes(); // // now loop, positioning each pane and letting children resize themselves // var pos = 0; var size = children[0].sizeActual; this._movePanel(children[0], pos, size); children[0].position = pos; pos += size; // if we don't have any sizers, our layout method hasn't been called yet // so bail until we are called..TODO: REVISIT: need to change the startup // algorithm to guaranteed the ordering of calls to layout method if(!this.sizers){ return; } dojo.some(children.slice(1), function(child, i){ // error-checking if(!this.sizers[i]){ return true; } // first we position the sizing handle before this pane this._moveSlider(this.sizers[i], pos, this.sizerWidth); this.sizers[i].position = pos; pos += this.sizerWidth; size = child.sizeActual; this._movePanel(child, pos, size); child.position = pos; pos += size; }, this); }, _movePanel: function(panel, pos, size){ if(this.isHorizontal){ panel.domNode.style.left = pos + 'px'; // TODO: resize() takes l and t parameters too, don't need to set manually panel.domNode.style.top = 0; var box = {w: size, h: this.paneHeight}; if(panel.resize){ panel.resize(box); }else{ dojo.marginBox(panel.domNode, box); } }else{ panel.domNode.style.left = 0; // TODO: resize() takes l and t parameters too, don't need to set manually panel.domNode.style.top = pos + 'px'; var box = {w: this.paneWidth, h: size}; if(panel.resize){ panel.resize(box); }else{ dojo.marginBox(panel.domNode, box); } } }, _moveSlider: function(slider, pos, size){ if(this.isHorizontal){ slider.style.left = pos + 'px'; slider.style.top = 0; dojo.marginBox(slider, { w: size, h: this.paneHeight }); }else{ slider.style.left = 0; slider.style.top = pos + 'px'; dojo.marginBox(slider, { w: this.paneWidth, h: size }); } }, _growPane: function(growth, pane){ if(growth > 0){ if(pane.sizeActual > pane.sizeMin){ if((pane.sizeActual - pane.sizeMin) > growth){ // stick all the growth in this pane pane.sizeActual = pane.sizeActual - growth; growth = 0; }else{ // put as much growth in here as we can growth -= pane.sizeActual - pane.sizeMin; pane.sizeActual = pane.sizeMin; } } } return growth; }, _checkSizes: function(){ var totalMinSize = 0; var totalSize = 0; var children = this.getChildren(); dojo.forEach(children, function(child){ totalSize += child.sizeActual; totalMinSize += child.sizeMin; }); // only make adjustments if we have enough space for all the minimums if(totalMinSize <= totalSize){ var growth = 0; dojo.forEach(children, function(child){ if(child.sizeActual < child.sizeMin){ growth += child.sizeMin - child.sizeActual; child.sizeActual = child.sizeMin; } }); if(growth > 0){ var list = this.isDraggingLeft ? children.reverse() : children; dojo.forEach(list, function(child){ growth = this._growPane(growth, child); }, this); } }else{ dojo.forEach(children, function(child){ child.sizeActual = Math.round(totalSize * (child.sizeMin / totalMinSize)); }); } }, beginSizing: function(e, i){ var children = this.getChildren(); this.paneBefore = children[i]; this.paneAfter = children[i+1]; this.isSizing = true; this.sizingSplitter = this.sizers[i]; if(!this.cover){ this.cover = dojo.create('div', { style: { position:'absolute', zIndex:5, top: 0, left: 0, width: "100%", height: "100%" } }, this.domNode); }else{ this.cover.style.zIndex = 5; } this.sizingSplitter.style.zIndex = 6; // TODO: REVISIT - we want MARGIN_BOX and core hasn't exposed that yet (but can't we use it anyway if we pay attention? we do elsewhere.) this.originPos = dojo.coords(children[0].domNode, true); if(this.isHorizontal){ var client = e.layerX || e.offsetX || 0; var screen = e.pageX; this.originPos = this.originPos.x; }else{ var client = e.layerY || e.offsetY || 0; var screen = e.pageY; this.originPos = this.originPos.y; } this.startPoint = this.lastPoint = screen; this.screenToClientOffset = screen - client; this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position; if(!this.activeSizing){ this._showSizingLine(); } // // attach mouse events // this._ownconnects = []; this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmousemove", this, "changeSizing")); this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmouseup", this, "endSizing")); dojo.stopEvent(e); }, changeSizing: function(e){ if(!this.isSizing){ return; } this.lastPoint = this.isHorizontal ? e.pageX : e.pageY; this.movePoint(); if(this.activeSizing){ this._updateSize(); }else{ this._moveSizingLine(); } dojo.stopEvent(e); }, endSizing: function(e){ if(!this.isSizing){ return; } if(this.cover){ this.cover.style.zIndex = -1; } if(!this.activeSizing){ this._hideSizingLine(); } this._updateSize(); this.isSizing = false; if(this.persist){ this._saveState(this); } dojo.forEach(this._ownconnects,dojo.disconnect); }, movePoint: function(){ // make sure lastPoint is a legal point to drag to var p = this.lastPoint - this.screenToClientOffset; var a = p - this.dragOffset; a = this.legaliseSplitPoint(a); p = a + this.dragOffset; this.lastPoint = p + this.screenToClientOffset;";s:7:"summary";s:0:"";}s:46:"dijit.layout.SplitContainer.legaliseSplitPoint";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"a";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:430:" a += this.sizingSplitter.position; this.isDraggingLeft = !!(a > 0); if(!this.activeSizing){ var min = this.paneBefore.position + this.paneBefore.sizeMin; if(a < min){ a = min; } var max = this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin)); if(a > max){ a = max; } } a -= this.sizingSplitter.position; this._checkSizes(); return a;";s:7:"summary";s:0:"";}s:39:"dijit.layout.SplitContainer._updateSize";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:13630:"dojo.provide("dijit.layout.SplitContainer"); // // FIXME: make it prettier // FIXME: active dragging upwards doesn't always shift other bars (direction calculation is wrong in this case) // dojo.require("dojo.cookie"); dojo.require("dijit.layout._LayoutWidget"); dojo.declare("dijit.layout.SplitContainer", dijit.layout._LayoutWidget, { // summary: // Deprecated. Use `dijit.layout.BorderContainer` instead. // description: // A Container widget with sizing handles in-between each child. // Contains multiple children widgets, all of which are displayed side by side // (either horizontally or vertically); there's a bar between each of the children, // and you can adjust the relative size of each child by dragging the bars. // // You must specify a size (width and height) for the SplitContainer. // tags: // deprecated constructor: function(){ dojo.deprecated("dijit.layout.SplitContainer is deprecated", "use BorderContainer with splitter instead", 2.0); }, // activeSizing: Boolean // If true, the children's size changes as you drag the bar; // otherwise, the sizes don't change until you drop the bar (by mouse-up) activeSizing: false, // sizerWidth: Integer // Size in pixels of the bar between each child sizerWidth: 7, // FIXME: this should be a CSS attribute (at 7 because css wants it to be 7 until we fix to css) // orientation: String // either 'horizontal' or vertical; indicates whether the children are // arranged side-by-side or up/down. orientation: 'horizontal', // persist: Boolean // Save splitter positions in a cookie persist: true, baseClass: "dijitSplitContainer", postMixInProperties: function(){ this.inherited("postMixInProperties",arguments); this.isHorizontal = (this.orientation == 'horizontal'); }, postCreate: function(){ this.inherited(arguments); this.sizers = []; // overflow has to be explicitly hidden for splitContainers using gekko (trac #1435) // to keep other combined css classes from inadvertantly making the overflow visible if(dojo.isMozilla){ this.domNode.style.overflow = '-moz-scrollbars-none'; // hidden doesn't work } // create the fake dragger if(typeof this.sizerWidth == "object"){ try{ //FIXME: do this without a try/catch this.sizerWidth = parseInt(this.sizerWidth.toString()); }catch(e){ this.sizerWidth = 7; } } var sizer = dojo.doc.createElement('div'); this.virtualSizer = sizer; sizer.style.position = 'relative'; // #1681: work around the dreaded 'quirky percentages in IE' layout bug // If the splitcontainer's dimensions are specified in percentages, it // will be resized when the virtualsizer is displayed in _showSizingLine // (typically expanding its bounds unnecessarily). This happens because // we use position: relative for .dijitSplitContainer. // The workaround: instead of changing the display style attribute, // switch to changing the zIndex (bring to front/move to back) sizer.style.zIndex = 10; sizer.className = this.isHorizontal ? 'dijitSplitContainerVirtualSizerH' : 'dijitSplitContainerVirtualSizerV'; this.domNode.appendChild(sizer); dojo.setSelectable(sizer, false); }, destroy: function(){ delete this.virtualSizer; dojo.forEach(this._ownconnects, dojo.disconnect); this.inherited(arguments); }, startup: function(){ if(this._started){ return; } dojo.forEach(this.getChildren(), function(child, i, children){ // attach the children and create the draggers this._setupChild(child); if(i < children.length-1){ this._addSizer(); } }, this); if(this.persist){ this._restoreState(); } this.inherited(arguments); }, _setupChild: function(/*Widget*/ child){ this.inherited(arguments); child.domNode.style.position = "absolute"; dojo.addClass(child.domNode, "dijitSplitPane"); }, _onSizerMouseDown: function(e){ if(e.target.id){ for(var i=0;i 1){ this._addSizer(insertIndex); } // and then reposition (ie, shrink) every pane to make room for the new guy this.layout(); } }, layout: function(){ // summary: // Do layout of panels // base class defines this._contentBox on initial creation and also // on resize this.paneWidth = this._contentBox.w; this.paneHeight = this._contentBox.h; var children = this.getChildren(); if(!children.length){ return; } // // calculate space // var space = this.isHorizontal ? this.paneWidth : this.paneHeight; if(children.length > 1){ space -= this.sizerWidth * (children.length - 1); } // // calculate total of SizeShare values // var outOf = 0; dojo.forEach(children, function(child){ outOf += child.sizeShare; }); // // work out actual pixels per sizeshare unit // var pixPerUnit = space / outOf; // // set the SizeActual member of each pane // var totalSize = 0; dojo.forEach(children.slice(0, children.length - 1), function(child){ var size = Math.round(pixPerUnit * child.sizeShare); child.sizeActual = size; totalSize += size; }); children[children.length-1].sizeActual = space - totalSize; // // make sure the sizes are ok // this._checkSizes(); // // now loop, positioning each pane and letting children resize themselves // var pos = 0; var size = children[0].sizeActual; this._movePanel(children[0], pos, size); children[0].position = pos; pos += size; // if we don't have any sizers, our layout method hasn't been called yet // so bail until we are called..TODO: REVISIT: need to change the startup // algorithm to guaranteed the ordering of calls to layout method if(!this.sizers){ return; } dojo.some(children.slice(1), function(child, i){ // error-checking if(!this.sizers[i]){ return true; } // first we position the sizing handle before this pane this._moveSlider(this.sizers[i], pos, this.sizerWidth); this.sizers[i].position = pos; pos += this.sizerWidth; size = child.sizeActual; this._movePanel(child, pos, size); child.position = pos; pos += size; }, this); }, _movePanel: function(panel, pos, size){ if(this.isHorizontal){ panel.domNode.style.left = pos + 'px'; // TODO: resize() takes l and t parameters too, don't need to set manually panel.domNode.style.top = 0; var box = {w: size, h: this.paneHeight}; if(panel.resize){ panel.resize(box); }else{ dojo.marginBox(panel.domNode, box); } }else{ panel.domNode.style.left = 0; // TODO: resize() takes l and t parameters too, don't need to set manually panel.domNode.style.top = pos + 'px'; var box = {w: this.paneWidth, h: size}; if(panel.resize){ panel.resize(box); }else{ dojo.marginBox(panel.domNode, box); } } }, _moveSlider: function(slider, pos, size){ if(this.isHorizontal){ slider.style.left = pos + 'px'; slider.style.top = 0; dojo.marginBox(slider, { w: size, h: this.paneHeight }); }else{ slider.style.left = 0; slider.style.top = pos + 'px'; dojo.marginBox(slider, { w: this.paneWidth, h: size }); } }, _growPane: function(growth, pane){ if(growth > 0){ if(pane.sizeActual > pane.sizeMin){ if((pane.sizeActual - pane.sizeMin) > growth){ // stick all the growth in this pane pane.sizeActual = pane.sizeActual - growth; growth = 0; }else{ // put as much growth in here as we can growth -= pane.sizeActual - pane.sizeMin; pane.sizeActual = pane.sizeMin; } } } return growth; }, _checkSizes: function(){ var totalMinSize = 0; var totalSize = 0; var children = this.getChildren(); dojo.forEach(children, function(child){ totalSize += child.sizeActual; totalMinSize += child.sizeMin; }); // only make adjustments if we have enough space for all the minimums if(totalMinSize <= totalSize){ var growth = 0; dojo.forEach(children, function(child){ if(child.sizeActual < child.sizeMin){ growth += child.sizeMin - child.sizeActual; child.sizeActual = child.sizeMin; } }); if(growth > 0){ var list = this.isDraggingLeft ? children.reverse() : children; dojo.forEach(list, function(child){ growth = this._growPane(growth, child); }, this); } }else{ dojo.forEach(children, function(child){ child.sizeActual = Math.round(totalSize * (child.sizeMin / totalMinSize)); }); } }, beginSizing: function(e, i){ var children = this.getChildren(); this.paneBefore = children[i]; this.paneAfter = children[i+1]; this.isSizing = true; this.sizingSplitter = this.sizers[i]; if(!this.cover){ this.cover = dojo.create('div', { style: { position:'absolute', zIndex:5, top: 0, left: 0, width: "100%", height: "100%" } }, this.domNode); }else{ this.cover.style.zIndex = 5; } this.sizingSplitter.style.zIndex = 6; // TODO: REVISIT - we want MARGIN_BOX and core hasn't exposed that yet (but can't we use it anyway if we pay attention? we do elsewhere.) this.originPos = dojo.coords(children[0].domNode, true); if(this.isHorizontal){ var client = e.layerX || e.offsetX || 0; var screen = e.pageX; this.originPos = this.originPos.x; }else{ var client = e.layerY || e.offsetY || 0; var screen = e.pageY; this.originPos = this.originPos.y; } this.startPoint = this.lastPoint = screen; this.screenToClientOffset = screen - client; this.dragOffset = this.lastPoint - this.paneBefore.sizeActual - this.originPos - this.paneBefore.position; if(!this.activeSizing){ this._showSizingLine(); } // // attach mouse events // this._ownconnects = []; this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmousemove", this, "changeSizing")); this._ownconnects.push(dojo.connect(dojo.doc.documentElement, "onmouseup", this, "endSizing")); dojo.stopEvent(e); }, changeSizing: function(e){ if(!this.isSizing){ return; } this.lastPoint = this.isHorizontal ? e.pageX : e.pageY; this.movePoint(); if(this.activeSizing){ this._updateSize(); }else{ this._moveSizingLine(); } dojo.stopEvent(e); }, endSizing: function(e){ if(!this.isSizing){ return; } if(this.cover){ this.cover.style.zIndex = -1; } if(!this.activeSizing){ this._hideSizingLine(); } this._updateSize(); this.isSizing = false; if(this.persist){ this._saveState(this); } dojo.forEach(this._ownconnects,dojo.disconnect); }, movePoint: function(){ // make sure lastPoint is a legal point to drag to var p = this.lastPoint - this.screenToClientOffset; var a = p - this.dragOffset; a = this.legaliseSplitPoint(a); p = a + this.dragOffset; this.lastPoint = p + this.screenToClientOffset; }, legaliseSplitPoint: function(a){ a += this.sizingSplitter.position; this.isDraggingLeft = !!(a > 0); if(!this.activeSizing){ var min = this.paneBefore.position + this.paneBefore.sizeMin; if(a < min){ a = min; } var max = this.paneAfter.position + (this.paneAfter.sizeActual - (this.sizerWidth + this.paneAfter.sizeMin)); if(a > max){ a = max; } } a -= this.sizingSplitter.position; this._checkSizes(); return a; }, _updateSize: function(){ //FIXME: sometimes this.lastPoint is NaN var pos = this.lastPoint - this.dragOffset - this.originPos; var start_region = this.paneBefore.position; var end_region = this.paneAfter.position + this.paneAfter.sizeActual; this.paneBefore.sizeActual = pos - start_region; this.paneAfter.position = pos + this.sizerWidth; this.paneAfter.sizeActual = end_region - this.paneAfter.position; dojo.forEach(this.getChildren(), function(child){ child.sizeShare = child.sizeActual; }); if(this._started){ this.layout(); }";s:7:"private";b:1;s:7:"summary";s:0:"";}s:43:"dijit.layout.SplitContainer._showSizingLine";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:222:" this._moveSizingLine(); dojo.marginBox(this.virtualSizer, this.isHorizontal ? { w: this.sizerWidth, h: this.paneHeight } : { w: this.paneWidth, h: this.sizerWidth }); this.virtualSizer.style.display = 'block';";s:7:"private";b:1;s:7:"summary";s:0:"";}s:43:"dijit.layout.SplitContainer._hideSizingLine";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:43:" this.virtualSizer.style.display = 'none';";s:7:"private";b:1;s:7:"summary";s:0:"";}s:43:"dijit.layout.SplitContainer._moveSizingLine";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:291:" var pos = (this.lastPoint - this.startPoint) + this.sizingSplitter.position; dojo.style(this.virtualSizer,(this.isHorizontal ? "left" : "top"),pos+"px"); // this.virtualSizer.style[ this.isHorizontal ? "left" : "top" ] = pos + 'px'; // FIXME: remove this line if the previous is better";s:7:"private";b:1;s:7:"summary";s:0:"";}s:42:"dijit.layout.SplitContainer._getCookieName";a:6:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:1:"i";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:27:" return this.id + "_" + i;";s:7:"private";b:1;s:7:"summary";s:0:"";}s:41:"dijit.layout.SplitContainer._restoreState";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:284:" dojo.forEach(this.getChildren(), function(child, i){ var cookieName = this._getCookieName(i); var cookieValue = dojo.cookie(cookieName); if(cookieValue){ var pos = parseInt(cookieValue); if(typeof pos == "number"){ child.sizeShare = pos; } } }, this);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:38:"dijit.layout.SplitContainer._saveState";a:5:{s:9:"prototype";s:27:"dijit.layout.SplitContainer";s:4:"type";s:8:"Function";s:6:"source";s:174:" if(!this.persist){ return; } dojo.forEach(this.getChildren(), function(child, i){ dojo.cookie(this._getCookieName(i), child.sizeShare, {expires:365}); }, this);";s:7:"private";b:1;s:7:"summary";s:0:"";}s:40:"dijit.layout.SplitContainer.isHorizontal";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:34:"dijit.layout.SplitContainer.sizers";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:50:"dijit.layout.SplitContainer.domNode.style.overflow";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:40:"dijit.layout.SplitContainer.virtualSizer";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:37:"dijit.layout.SplitContainer.paneWidth";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:38:"dijit.layout.SplitContainer.paneHeight";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:38:"dijit.layout.SplitContainer.paneBefore";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:37:"dijit.layout.SplitContainer.paneAfter";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:36:"dijit.layout.SplitContainer.isSizing";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:42:"dijit.layout.SplitContainer.sizingSplitter";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:33:"dijit.layout.SplitContainer.cover";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:46:"dijit.layout.SplitContainer.cover.style.zIndex";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:55:"dijit.layout.SplitContainer.sizingSplitter.style.zIndex";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:37:"dijit.layout.SplitContainer.originPos";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:38:"dijit.layout.SplitContainer.startPoint";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:48:"dijit.layout.SplitContainer.screenToClientOffset";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:38:"dijit.layout.SplitContainer.dragOffset";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:40:"dijit.layout.SplitContainer._ownconnects";a:3:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"private";b:1;s:7:"summary";s:0:"";}s:37:"dijit.layout.SplitContainer.lastPoint";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:42:"dijit.layout.SplitContainer.isDraggingLeft";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:49:"dijit.layout.SplitContainer.paneBefore.sizeActual";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:46:"dijit.layout.SplitContainer.paneAfter.position";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:48:"dijit.layout.SplitContainer.paneAfter.sizeActual";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:54:"dijit.layout.SplitContainer.virtualSizer.style.display";a:2:{s:8:"instance";s:27:"dijit.layout.SplitContainer";s:7:"summary";s:0:"";}s:21:"dijit._Widget.sizeMin";a:2:{s:9:"prototype";s:13:"dijit._Widget";s:7:"summary";s:0:"";}s:23:"dijit._Widget.sizeShare";a:2:{s:9:"prototype";s:13:"dijit._Widget";s:7:"summary";s:0:"";}s:12:"dijit.layout";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dijit";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}