a:35:{s:9:"#provides";s:27:"dojox.layout.ToggleSplitter";s:9:"#resource";s:24:"layout/ToggleSplitter.js";s:9:"#requires";a:1:{i:0;a:3:{i:0;s:6:"common";i:1;s:28:"dijit.layout.BorderContainer";i:2;s:5:"dijit";}}s:27:"dojox.layout.ToggleSplitter";a:5:{s:4:"type";s:8:"Function";s:6:"chains";a:2:{s:9:"prototype";a:1:{i:0;s:22:"dijit.layout._Splitter";}s:4:"call";a:1:{i:0;s:22:"dijit.layout._Splitter";}}s:7:"summary";s:82:"A draggable and toggle-to-close/open spacer between two items in a BorderContainer";s:11:"description";s:77:"Extends the dijit.layout._Splitter to add a toggling behavior
on double-click";s:9:"classlike";b:1;}s:37:"dojox.layout.ToggleSplitter.container";a:2:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:7:"summary";s:0:"";}s:33:"dojox.layout.ToggleSplitter.child";a:2:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:7:"summary";s:0:"";}s:34:"dojox.layout.ToggleSplitter.region";a:2:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:7:"summary";s:0:"";}s:32:"dojox.layout.ToggleSplitter.open";a:4:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:8:"instance";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:7:"Boolean";s:7:"summary";s:69:"the initial and current state of the splitter (and its attached pane)";}s:43:"dojox.layout.ToggleSplitter.closedThreshold";a:3:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:7:"Integer";s:7:"summary";s:63:"how small the attached pane can be before its considered closed";}s:36:"dojox.layout.ToggleSplitter.openSize";a:4:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:8:"instance";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:6:"String";s:7:"summary";s:77:"the css height/width value to apply by default when the attached pane is open";}s:39:"dojox.layout.ToggleSplitter._closedSize";a:4:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:6:"String";s:7:"summary";s:79:"the css height/width value to apply by default when the attached pane is closed";s:7:"private";b:1;}s:42:"dojox.layout.ToggleSplitter.templateString";a:2:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:7:"summary";s:0:"";}s:38:"dojox.layout.ToggleSplitter.postCreate";a:4:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:8:"Function";s:6:"source";s:327:" this._started = false;
this.inherited(arguments);
// add a region css hook
var region = this.region;
dojo.addClass(this.domNode, "dojoxToggleSplitter"+region.charAt(0).toUpperCase() + region.substring(1));
// hook up double-clicks to toggle the splitter -
this.connect(this, "onDblClick", "_toggleMe");";s:7:"summary";s:0:"";}s:35:"dojox.layout.ToggleSplitter.startup";a:4:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:8:"Function";s:6:"source";s:1320:" this.inherited(arguments);
// we have to wait until startup to be sure the child exists in the dom
// and has non-zero size (if its supposed to be showing)
var paneNode = this.child.domNode,
intPaneSize = dojo.style(paneNode, (this.horizontal ? "height" : "width"));
// creation of splitters is an opaque process in BorderContainer,
// so if we want to get init params, we have to retrieve them from the attached BC child
// NOTE: for this to work we have to extend the prototype of dijit._Widget (some more)
dojo.forEach(["toggleSplitterOpen", "toggleSplitterClosedThreshold", "toggleSplitterOpenSize"], function(name){
var pname = name.substring("toggleSplitter".length);
pname = pname.charAt(0).toLowerCase() + pname.substring(1);
if(name in this.child){
this[pname] = this.child[name];
}
}, this);
if(!this.openSize){
// store the current size as the openSize if none was provided
// dojo.style always returns a integer (pixel) value for height/width
// use an arbirary default if a pane was initalized closed and no openSize provided
this.openSize = (this.open) ? intPaneSize + "px" : "75px";
}
this._openStyleProps = this._getStyleProps(paneNode, true);
// update state
this._started = true;
this.attr("open", this.open);
return this;";s:7:"summary";s:0:"";}s:38:"dojox.layout.ToggleSplitter._onMouseUp";a:6:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:159:" dojo.disconnect(this._onMoveHandle);
dojo.disconnect(this._onUpHandle);
delete this._onMoveHandle;
delete this._onUpHandle;
delete this._startPosn; ";s:7:"private";b:1;s:7:"summary";s:0:"";}s:46:"dojox.layout.ToggleSplitter._onPrelimMouseMove";a:6:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:3649:"dojo.provide("dojox.layout.ToggleSplitter");
dojo.experimental("dojox.layout.ToggleSplitter");
dojo.require("dijit.layout.BorderContainer");
dojo.declare("dojox.layout.ToggleSplitter", [ dijit.layout._Splitter ],
{
// summary:
// A draggable and toggle-to-close/open spacer between two items in a BorderContainer
//
// description:
// Extends the dijit.layout._Splitter to add a toggling behavior
// on double-click
//
container: null,
child: null,
region: null,
// open: Boolean
// the initial and current state of the splitter (and its attached pane)
open: true,
// closedThreshold: Integer
// how small the attached pane can be before its considered closed
closedThreshold: 5,
// openSize: String
// the css height/width value to apply by default when the attached pane is open
openSize: "",
// _closedSize: String
// the css height/width value to apply by default when the attached pane is closed
_closedSize: "0",
templateString: '
',
postCreate: function(){
this._started = false;
this.inherited(arguments);
// add a region css hook
var region = this.region;
dojo.addClass(this.domNode, "dojoxToggleSplitter"+region.charAt(0).toUpperCase() + region.substring(1));
// hook up double-clicks to toggle the splitter -
this.connect(this, "onDblClick", "_toggleMe");
},
startup: function(){
this.inherited(arguments);
// we have to wait until startup to be sure the child exists in the dom
// and has non-zero size (if its supposed to be showing)
var paneNode = this.child.domNode,
intPaneSize = dojo.style(paneNode, (this.horizontal ? "height" : "width"));
// creation of splitters is an opaque process in BorderContainer,
// so if we want to get init params, we have to retrieve them from the attached BC child
// NOTE: for this to work we have to extend the prototype of dijit._Widget (some more)
dojo.forEach(["toggleSplitterOpen", "toggleSplitterClosedThreshold", "toggleSplitterOpenSize"], function(name){
var pname = name.substring("toggleSplitter".length);
pname = pname.charAt(0).toLowerCase() + pname.substring(1);
if(name in this.child){
this[pname] = this.child[name];
}
}, this);
if(!this.openSize){
// store the current size as the openSize if none was provided
// dojo.style always returns a integer (pixel) value for height/width
// use an arbirary default if a pane was initalized closed and no openSize provided
this.openSize = (this.open) ? intPaneSize + "px" : "75px";
}
this._openStyleProps = this._getStyleProps(paneNode, true);
// update state
this._started = true;
this.attr("open", this.open);
return this;
},
_onMouseUp: function(evt){
dojo.disconnect(this._onMoveHandle);
dojo.disconnect(this._onUpHandle);
delete this._onMoveHandle;
delete this._onUpHandle;
delete this._startPosn;
},
_onPrelimMouseMove: function(evt){
// only start dragging when a mouse down AND a significant mousemove occurs
var startPosn = this._startPosn || 0;
// allow a little fudging in a click before we consider a drag started
var dragThreshold = 3;
var offset = Math.abs( startPosn - (this.horizontal ? evt.clientY : evt.clientX) );
if(offset >= dragThreshold){
// treat as a drag and dismantle this preliminary handlers
dojo.disconnect(this._onMoveHandle);
this._startDrag(evt);
}";s:7:"private";b:1;s:7:"summary";s:0:"";}s:40:"dojox.layout.ToggleSplitter._onMouseDown";a:6:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:3:"evt";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:592:" if(!this.open){
// ignore mousedown while closed
// - this has the effect of preventing dragging while closed, which is the prefered behavior (for now)
return;
}
// Mousedown can fire more than once (!)
// ..so check before connecting
if(!this._onUpHandle){
this._onUpHandle = dojo.connect(dojo.body(), "onmouseup", this, "_onMouseUp");
}
if(!this._onMoveHandle){
this._startPosn = this.horizontal ? evt.clientY : evt.clientX;
// start listening for mousemove
this._onMoveHandle = dojo.connect(dojo.body(), "onmousemove", this, "_onPrelimMouseMove");
}";s:7:"summary";s:40:"handle mousedown events from the domNode";s:7:"private";b:1;}s:43:"dojox.layout.ToggleSplitter._handleOnChange";a:5:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:8:"Function";s:6:"source";s:5516:"dojo.provide("dojox.layout.ToggleSplitter");
dojo.experimental("dojox.layout.ToggleSplitter");
dojo.require("dijit.layout.BorderContainer");
dojo.declare("dojox.layout.ToggleSplitter", [ dijit.layout._Splitter ],
{
// summary:
// A draggable and toggle-to-close/open spacer between two items in a BorderContainer
//
// description:
// Extends the dijit.layout._Splitter to add a toggling behavior
// on double-click
//
container: null,
child: null,
region: null,
// open: Boolean
// the initial and current state of the splitter (and its attached pane)
open: true,
// closedThreshold: Integer
// how small the attached pane can be before its considered closed
closedThreshold: 5,
// openSize: String
// the css height/width value to apply by default when the attached pane is open
openSize: "",
// _closedSize: String
// the css height/width value to apply by default when the attached pane is closed
_closedSize: "0",
templateString: '',
postCreate: function(){
this._started = false;
this.inherited(arguments);
// add a region css hook
var region = this.region;
dojo.addClass(this.domNode, "dojoxToggleSplitter"+region.charAt(0).toUpperCase() + region.substring(1));
// hook up double-clicks to toggle the splitter -
this.connect(this, "onDblClick", "_toggleMe");
},
startup: function(){
this.inherited(arguments);
// we have to wait until startup to be sure the child exists in the dom
// and has non-zero size (if its supposed to be showing)
var paneNode = this.child.domNode,
intPaneSize = dojo.style(paneNode, (this.horizontal ? "height" : "width"));
// creation of splitters is an opaque process in BorderContainer,
// so if we want to get init params, we have to retrieve them from the attached BC child
// NOTE: for this to work we have to extend the prototype of dijit._Widget (some more)
dojo.forEach(["toggleSplitterOpen", "toggleSplitterClosedThreshold", "toggleSplitterOpenSize"], function(name){
var pname = name.substring("toggleSplitter".length);
pname = pname.charAt(0).toLowerCase() + pname.substring(1);
if(name in this.child){
this[pname] = this.child[name];
}
}, this);
if(!this.openSize){
// store the current size as the openSize if none was provided
// dojo.style always returns a integer (pixel) value for height/width
// use an arbirary default if a pane was initalized closed and no openSize provided
this.openSize = (this.open) ? intPaneSize + "px" : "75px";
}
this._openStyleProps = this._getStyleProps(paneNode, true);
// update state
this._started = true;
this.attr("open", this.open);
return this;
},
_onMouseUp: function(evt){
dojo.disconnect(this._onMoveHandle);
dojo.disconnect(this._onUpHandle);
delete this._onMoveHandle;
delete this._onUpHandle;
delete this._startPosn;
},
_onPrelimMouseMove: function(evt){
// only start dragging when a mouse down AND a significant mousemove occurs
var startPosn = this._startPosn || 0;
// allow a little fudging in a click before we consider a drag started
var dragThreshold = 3;
var offset = Math.abs( startPosn - (this.horizontal ? evt.clientY : evt.clientX) );
if(offset >= dragThreshold){
// treat as a drag and dismantle this preliminary handlers
dojo.disconnect(this._onMoveHandle);
this._startDrag(evt);
}
},
_onMouseDown: function(evt){
// summary:
// handle mousedown events from the domNode
if(!this.open){
// ignore mousedown while closed
// - this has the effect of preventing dragging while closed, which is the prefered behavior (for now)
return;
}
// Mousedown can fire more than once (!)
// ..so check before connecting
if(!this._onUpHandle){
this._onUpHandle = dojo.connect(dojo.body(), "onmouseup", this, "_onMouseUp");
}
if(!this._onMoveHandle){
this._startPosn = this.horizontal ? evt.clientY : evt.clientX;
// start listening for mousemove
this._onMoveHandle = dojo.connect(dojo.body(), "onmousemove", this, "_onPrelimMouseMove");
}
},
_handleOnChange: function(){
// summary
// effect the state change with the new value of this.open
// TODO: animate the open/close
var paneNode = this.child.domNode,
openProps,
dim = this.horizontal ? "height" : "width";
if(this.open){
// change to open state
var styleProps = dojo.mixin({
display: "block",
overflow: "auto",
visibility: "visible"
}, this._openStyleProps);
styleProps[dim] = (this._openStyleProps && this._openStyleProps[dim]) ? this._openStyleProps[dim] : this.openSize;
dojo.style(paneNode, styleProps);
// and re-hook up the mouse event handler
this.connect(this.domNode, "onmousedown", "_onMouseDown");
} else {
// change to closed state
// FIXME: this wont work in a drag-to-closed scenario
var paneStyle = dojo.getComputedStyle(paneNode);
openProps = this._getStyleProps(paneNode, true, paneStyle);
var closedProps = this._getStyleProps(paneNode, false, paneStyle);
this._openStyleProps = openProps;
dojo.style(paneNode, closedProps);
}
this._setStateClass();
if(this.container._started){
this.container._layoutChildren(this.region);
}";s:7:"private";b:1;s:7:"summary";s:0:"";}s:42:"dojox.layout.ToggleSplitter._getStyleProps";a:6:{s:9:"prototype";s:27:"dojox.layout.ToggleSplitter";s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:8:"paneNode";a:1:{s:4:"type";s:0:"";}s:4:"open";a:1:{s:4:"type";s:0:"";}s:9:"paneStyle";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:971:" if(!paneStyle){
paneStyle = dojo.getComputedStyle(paneNode);
}
var styleProps = {},
dim = this.horizontal ? "height" : "width";
styleProps["overflow"] = (open) ? paneStyle["overflow"] : "hidden";
styleProps["visibility"] = (open) ? paneStyle["visibility"] : "hidden";
// use the inline width/height style value, in preference to the computedStyle
// for the open width/height
styleProps[dim] = (open) ? paneNode.style[dim] || paneStyle[dim] : this._closedSize;
// We include the padding,border,margin width values for restoring on open
var edgeNames = ["Top", "Right", "Bottom", "Left"];
dojo.forEach(["padding","margin","border"], function(pname){
for(var i=0; i',
postCreate: function(){
this._started = false;
this.inherited(arguments);
// add a region css hook
var region = this.region;
dojo.addClass(this.domNode, "dojoxToggleSplitter"+region.charAt(0).toUpperCase() + region.substring(1));
// hook up double-clicks to toggle the splitter -
this.connect(this, "onDblClick", "_toggleMe");
},
startup: function(){
this.inherited(arguments);
// we have to wait until startup to be sure the child exists in the dom
// and has non-zero size (if its supposed to be showing)
var paneNode = this.child.domNode,
intPaneSize = dojo.style(paneNode, (this.horizontal ? "height" : "width"));
// creation of splitters is an opaque process in BorderContainer,
// so if we want to get init params, we have to retrieve them from the attached BC child
// NOTE: for this to work we have to extend the prototype of dijit._Widget (some more)
dojo.forEach(["toggleSplitterOpen", "toggleSplitterClosedThreshold", "toggleSplitterOpenSize"], function(name){
var pname = name.substring("toggleSplitter".length);
pname = pname.charAt(0).toLowerCase() + pname.substring(1);
if(name in this.child){
this[pname] = this.child[name];
}
}, this);
if(!this.openSize){
// store the current size as the openSize if none was provided
// dojo.style always returns a integer (pixel) value for height/width
// use an arbirary default if a pane was initalized closed and no openSize provided
this.openSize = (this.open) ? intPaneSize + "px" : "75px";
}
this._openStyleProps = this._getStyleProps(paneNode, true);
// update state
this._started = true;
this.attr("open", this.open);
return this;
},
_onMouseUp: function(evt){
dojo.disconnect(this._onMoveHandle);
dojo.disconnect(this._onUpHandle);
delete this._onMoveHandle;
delete this._onUpHandle;
delete this._startPosn;
},
_onPrelimMouseMove: function(evt){
// only start dragging when a mouse down AND a significant mousemove occurs
var startPosn = this._startPosn || 0;
// allow a little fudging in a click before we consider a drag started
var dragThreshold = 3;
var offset = Math.abs( startPosn - (this.horizontal ? evt.clientY : evt.clientX) );
if(offset >= dragThreshold){
// treat as a drag and dismantle this preliminary handlers
dojo.disconnect(this._onMoveHandle);
this._startDrag(evt);
}
},
_onMouseDown: function(evt){
// summary:
// handle mousedown events from the domNode
if(!this.open){
// ignore mousedown while closed
// - this has the effect of preventing dragging while closed, which is the prefered behavior (for now)
return;
}
// Mousedown can fire more than once (!)
// ..so check before connecting
if(!this._onUpHandle){
this._onUpHandle = dojo.connect(dojo.body(), "onmouseup", this, "_onMouseUp");
}
if(!this._onMoveHandle){
this._startPosn = this.horizontal ? evt.clientY : evt.clientX;
// start listening for mousemove
this._onMoveHandle = dojo.connect(dojo.body(), "onmousemove", this, "_onPrelimMouseMove");
}
},
_handleOnChange: function(){
// summary
// effect the state change with the new value of this.open
// TODO: animate the open/close
var paneNode = this.child.domNode,
openProps,
dim = this.horizontal ? "height" : "width";
if(this.open){
// change to open state
var styleProps = dojo.mixin({
display: "block",
overflow: "auto",
visibility: "visible"
}, this._openStyleProps);
styleProps[dim] = (this._openStyleProps && this._openStyleProps[dim]) ? this._openStyleProps[dim] : this.openSize;
dojo.style(paneNode, styleProps);
// and re-hook up the mouse event handler
this.connect(this.domNode, "onmousedown", "_onMouseDown");
} else {
// change to closed state
// FIXME: this wont work in a drag-to-closed scenario
var paneStyle = dojo.getComputedStyle(paneNode);
openProps = this._getStyleProps(paneNode, true, paneStyle);
var closedProps = this._getStyleProps(paneNode, false, paneStyle);
this._openStyleProps = openProps;
dojo.style(paneNode, closedProps);
}
this._setStateClass();
if(this.container._started){
this.container._layoutChildren(this.region);
}
},
_getStyleProps: function(paneNode, open, paneStyle){
// summary:
// create an object with the style property name: values
// that will need to be applied to the child pane render the given state
if(!paneStyle){
paneStyle = dojo.getComputedStyle(paneNode);
}
var styleProps = {},
dim = this.horizontal ? "height" : "width";
styleProps["overflow"] = (open) ? paneStyle["overflow"] : "hidden";
styleProps["visibility"] = (open) ? paneStyle["visibility"] : "hidden";
// use the inline width/height style value, in preference to the computedStyle
// for the open width/height
styleProps[dim] = (open) ? paneNode.style[dim] || paneStyle[dim] : this._closedSize;
// We include the padding,border,margin width values for restoring on open
var edgeNames = ["Top", "Right", "Bottom", "Left"];
dojo.forEach(["padding","margin","border"], function(pname){
for(var i=0; i',
postCreate: function(){
this._started = false;
this.inherited(arguments);
// add a region css hook
var region = this.region;
dojo.addClass(this.domNode, "dojoxToggleSplitter"+region.charAt(0).toUpperCase() + region.substring(1));
// hook up double-clicks to toggle the splitter -
this.connect(this, "onDblClick", "_toggleMe");
},
startup: function(){
this.inherited(arguments);
// we have to wait until startup to be sure the child exists in the dom
// and has non-zero size (if its supposed to be showing)
var paneNode = this.child.domNode,
intPaneSize = dojo.style(paneNode, (this.horizontal ? "height" : "width"));
// creation of splitters is an opaque process in BorderContainer,
// so if we want to get init params, we have to retrieve them from the attached BC child
// NOTE: for this to work we have to extend the prototype of dijit._Widget (some more)
dojo.forEach(["toggleSplitterOpen", "toggleSplitterClosedThreshold", "toggleSplitterOpenSize"], function(name){
var pname = name.substring("toggleSplitter".length);
pname = pname.charAt(0).toLowerCase() + pname.substring(1);
if(name in this.child){
this[pname] = this.child[name];
}
}, this);
if(!this.openSize){
// store the current size as the openSize if none was provided
// dojo.style always returns a integer (pixel) value for height/width
// use an arbirary default if a pane was initalized closed and no openSize provided
this.openSize = (this.open) ? intPaneSize + "px" : "75px";
}
this._openStyleProps = this._getStyleProps(paneNode, true);
// update state
this._started = true;
this.attr("open", this.open);
return this;
},
_onMouseUp: function(evt){
dojo.disconnect(this._onMoveHandle);
dojo.disconnect(this._onUpHandle);
delete this._onMoveHandle;
delete this._onUpHandle;
delete this._startPosn;
},
_onPrelimMouseMove: function(evt){
// only start dragging when a mouse down AND a significant mousemove occurs
var startPosn = this._startPosn || 0;
// allow a little fudging in a click before we consider a drag started
var dragThreshold = 3;
var offset = Math.abs( startPosn - (this.horizontal ? evt.clientY : evt.clientX) );
if(offset >= dragThreshold){
// treat as a drag and dismantle this preliminary handlers
dojo.disconnect(this._onMoveHandle);
this._startDrag(evt);
}
},
_onMouseDown: function(evt){
// summary:
// handle mousedown events from the domNode
if(!this.open){
// ignore mousedown while closed
// - this has the effect of preventing dragging while closed, which is the prefered behavior (for now)
return;
}
// Mousedown can fire more than once (!)
// ..so check before connecting
if(!this._onUpHandle){
this._onUpHandle = dojo.connect(dojo.body(), "onmouseup", this, "_onMouseUp");
}
if(!this._onMoveHandle){
this._startPosn = this.horizontal ? evt.clientY : evt.clientX;
// start listening for mousemove
this._onMoveHandle = dojo.connect(dojo.body(), "onmousemove", this, "_onPrelimMouseMove");
}
},
_handleOnChange: function(){
// summary
// effect the state change with the new value of this.open
// TODO: animate the open/close
var paneNode = this.child.domNode,
openProps,
dim = this.horizontal ? "height" : "width";
if(this.open){
// change to open state
var styleProps = dojo.mixin({
display: "block",
overflow: "auto",
visibility: "visible"
}, this._openStyleProps);
styleProps[dim] = (this._openStyleProps && this._openStyleProps[dim]) ? this._openStyleProps[dim] : this.openSize;
dojo.style(paneNode, styleProps);
// and re-hook up the mouse event handler
this.connect(this.domNode, "onmousedown", "_onMouseDown");
} else {
// change to closed state
// FIXME: this wont work in a drag-to-closed scenario
var paneStyle = dojo.getComputedStyle(paneNode);
openProps = this._getStyleProps(paneNode, true, paneStyle);
var closedProps = this._getStyleProps(paneNode, false, paneStyle);
this._openStyleProps = openProps;
dojo.style(paneNode, closedProps);
}
this._setStateClass();
if(this.container._started){
this.container._layoutChildren(this.region);
}
},
_getStyleProps: function(paneNode, open, paneStyle){
// summary:
// create an object with the style property name: values
// that will need to be applied to the child pane render the given state
if(!paneStyle){
paneStyle = dojo.getComputedStyle(paneNode);
}
var styleProps = {},
dim = this.horizontal ? "height" : "width";
styleProps["overflow"] = (open) ? paneStyle["overflow"] : "hidden";
styleProps["visibility"] = (open) ? paneStyle["visibility"] : "hidden";
// use the inline width/height style value, in preference to the computedStyle
// for the open width/height
styleProps[dim] = (open) ? paneNode.style[dim] || paneStyle[dim] : this._closedSize;
// We include the padding,border,margin width values for restoring on open
var edgeNames = ["Top", "Right", "Bottom", "Left"];
dojo.forEach(["padding","margin","border"], function(pname){
for(var i=0; i',
postCreate: function(){
this._started = false;
this.inherited(arguments);
// add a region css hook
var region = this.region;
dojo.addClass(this.domNode, "dojoxToggleSplitter"+region.charAt(0).toUpperCase() + region.substring(1));
// hook up double-clicks to toggle the splitter -
this.connect(this, "onDblClick", "_toggleMe");
},
startup: function(){
this.inherited(arguments);
// we have to wait until startup to be sure the child exists in the dom
// and has non-zero size (if its supposed to be showing)
var paneNode = this.child.domNode,
intPaneSize = dojo.style(paneNode, (this.horizontal ? "height" : "width"));
// creation of splitters is an opaque process in BorderContainer,
// so if we want to get init params, we have to retrieve them from the attached BC child
// NOTE: for this to work we have to extend the prototype of dijit._Widget (some more)
dojo.forEach(["toggleSplitterOpen", "toggleSplitterClosedThreshold", "toggleSplitterOpenSize"], function(name){
var pname = name.substring("toggleSplitter".length);
pname = pname.charAt(0).toLowerCase() + pname.substring(1);
if(name in this.child){
this[pname] = this.child[name];
}
}, this);
if(!this.openSize){
// store the current size as the openSize if none was provided
// dojo.style always returns a integer (pixel) value for height/width
// use an arbirary default if a pane was initalized closed and no openSize provided
this.openSize = (this.open) ? intPaneSize + "px" : "75px";
}
this._openStyleProps = this._getStyleProps(paneNode, true);
// update state
this._started = true;
this.attr("open", this.open);
return this;
},
_onMouseUp: function(evt){
dojo.disconnect(this._onMoveHandle);
dojo.disconnect(this._onUpHandle);
delete this._onMoveHandle;
delete this._onUpHandle;
delete this._startPosn;
},
_onPrelimMouseMove: function(evt){
// only start dragging when a mouse down AND a significant mousemove occurs
var startPosn = this._startPosn || 0;
// allow a little fudging in a click before we consider a drag started
var dragThreshold = 3;
var offset = Math.abs( startPosn - (this.horizontal ? evt.clientY : evt.clientX) );
if(offset >= dragThreshold){
// treat as a drag and dismantle this preliminary handlers
dojo.disconnect(this._onMoveHandle);
this._startDrag(evt);
}
},
_onMouseDown: function(evt){
// summary:
// handle mousedown events from the domNode
if(!this.open){
// ignore mousedown while closed
// - this has the effect of preventing dragging while closed, which is the prefered behavior (for now)
return;
}
// Mousedown can fire more than once (!)
// ..so check before connecting
if(!this._onUpHandle){
this._onUpHandle = dojo.connect(dojo.body(), "onmouseup", this, "_onMouseUp");
}
if(!this._onMoveHandle){
this._startPosn = this.horizontal ? evt.clientY : evt.clientX;
// start listening for mousemove
this._onMoveHandle = dojo.connect(dojo.body(), "onmousemove", this, "_onPrelimMouseMove");
}
},
_handleOnChange: function(){
// summary
// effect the state change with the new value of this.open
// TODO: animate the open/close
var paneNode = this.child.domNode,
openProps,
dim = this.horizontal ? "height" : "width";
if(this.open){
// change to open state
var styleProps = dojo.mixin({
display: "block",
overflow: "auto",
visibility: "visible"
}, this._openStyleProps);
styleProps[dim] = (this._openStyleProps && this._openStyleProps[dim]) ? this._openStyleProps[dim] : this.openSize;
dojo.style(paneNode, styleProps);
// and re-hook up the mouse event handler
this.connect(this.domNode, "onmousedown", "_onMouseDown");
} else {
// change to closed state
// FIXME: this wont work in a drag-to-closed scenario
var paneStyle = dojo.getComputedStyle(paneNode);
openProps = this._getStyleProps(paneNode, true, paneStyle);
var closedProps = this._getStyleProps(paneNode, false, paneStyle);
this._openStyleProps = openProps;
dojo.style(paneNode, closedProps);
}
this._setStateClass();
if(this.container._started){
this.container._layoutChildren(this.region);
}
},
_getStyleProps: function(paneNode, open, paneStyle){
// summary:
// create an object with the style property name: values
// that will need to be applied to the child pane render the given state
if(!paneStyle){
paneStyle = dojo.getComputedStyle(paneNode);
}
var styleProps = {},
dim = this.horizontal ? "height" : "width";
styleProps["overflow"] = (open) ? paneStyle["overflow"] : "hidden";
styleProps["visibility"] = (open) ? paneStyle["visibility"] : "hidden";
// use the inline width/height style value, in preference to the computedStyle
// for the open width/height
styleProps[dim] = (open) ? paneNode.style[dim] || paneStyle[dim] : this._closedSize;
// We include the padding,border,margin width values for restoring on open
var edgeNames = ["Top", "Right", "Bottom", "Left"];
dojo.forEach(["padding","margin","border"], function(pname){
for(var i=0; i