dijit.layout._Splitter._startDrag
dojo.require("dijit.layout.BorderContainer");
defined in dijit/layout/BorderContainer.js
Usage
function (e) (view source)
if(!this.cover){ this.cover = dojo.doc.createElement('div'); dojo.addClass(this.cover, "dijitSplitterCover"); dojo.place(this.cover, this.child.domNode, "after"); }else{ this.cover.style.zIndex = 1; } // Safeguard in case the stop event was missed. Shouldn't be necessary if we always get the mouse up. if(this.fake){ dojo._destroyElement(this.fake); } if(!(this._resize = this.live)){ //TODO: disable live for IE6? // create fake splitter to display at old position while we drag (this.fake = this.domNode.cloneNode(true)).removeAttribute("id"); dojo.addClass(this.domNode, "dijitSplitterShadow"); dojo.place(this.fake, this.domNode, "after"); } dojo.addClass(this.domNode, "dijitSplitterActive"); //Performance: load data info local vars for onmousevent function closure var factor = this._factor, max = this._maxSize, min = this._minSize || 10; var axis = this.horizontal ? "pageY" : "pageX"; var pageStart = e[axis]; var splitterStyle = this.domNode.style; var dim = this.horizontal ? 'h' : 'w'; var childStart = dojo.marginBox(this.child.domNode)[dim]; var splitterStart = parseInt(this.domNode.style[this.region]); var resize = this._resize; var region = this.region; var mb = {}; var childNode = this.child.domNode; var layoutFunc = dojo.hitch(this.container, this.container._layoutChildren); var de = dojo.doc.body; this._handlers = (this._handlers || []).concat([ dojo.connect(de, "onmousemove", this._drag = function(e, forceResize){ var delta = e[axis] - pageStart, childSize = factor * delta + childStart, boundChildSize = Math.max(Math.min(childSize, max), min); if(resize || forceResize){ mb[dim] = boundChildSize; // TODO: inefficient; we set the marginBox here and then immediately layoutFunc() needs to query it dojo.marginBox(childNode, mb); layoutFunc(region); } splitterStyle[region] = factor * delta + splitterStart + (boundChildSize - childSize) + "px"; }), dojo.connect(de, "onmouseup", this, "_stopDrag") ]); dojo.stopEvent(e);
parameter | type | description |
---|---|---|
e |