From 1354d17270961fff662d40f90521223f8fd0d73b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 14 Aug 2012 18:59:10 +0400 Subject: update dojo to 1.7.3 --- lib/dijit/tree/_dndContainer.js | 189 +--------------------------------------- 1 file changed, 2 insertions(+), 187 deletions(-) (limited to 'lib/dijit/tree/_dndContainer.js') diff --git a/lib/dijit/tree/_dndContainer.js b/lib/dijit/tree/_dndContainer.js index 9ee8e32ba..f361278c1 100644 --- a/lib/dijit/tree/_dndContainer.js +++ b/lib/dijit/tree/_dndContainer.js @@ -1,187 +1,2 @@ -/* - Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - -if(!dojo._hasResource["dijit.tree._dndContainer"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dijit.tree._dndContainer"] = true; -dojo.provide("dijit.tree._dndContainer"); -dojo.require("dojo.dnd.common"); -dojo.require("dojo.dnd.Container"); - - -dojo.getObject("tree", true, dojo); - -dijit.tree._compareNodes = function(n1, n2){ - if(n1 === n2){ - return 0; - } - - if('sourceIndex' in document.documentElement){ //IE - //TODO: does not yet work if n1 and/or n2 is a text node - return n1.sourceIndex - n2.sourceIndex; - }else if('compareDocumentPosition' in document.documentElement){ //FF, Opera - return n1.compareDocumentPosition(n2) & 2 ? 1: -1; - }else if(document.createRange){ //Webkit - var r1 = doc.createRange(); - r1.setStartBefore(n1); - - var r2 = doc.createRange(); - r2.setStartBefore(n2); - - return r1.compareBoundaryPoints(r1.END_TO_END, r2); - }else{ - throw Error("dijit.tree._compareNodes don't know how to compare two different nodes in this browser"); - } -}; - -dojo.declare("dijit.tree._dndContainer", - null, - { - - // summary: - // This is a base class for `dijit.tree._dndSelector`, and isn't meant to be used directly. - // It's modeled after `dojo.dnd.Container`. - // tags: - // protected - - /*===== - // current: DomNode - // The currently hovered TreeNode.rowNode (which is the DOM node - // associated w/a given node in the tree, excluding it's descendants) - current: null, - =====*/ - - constructor: function(tree, params){ - // summary: - // A constructor of the Container - // tree: Node - // Node or node's id to build the container on - // params: dijit.tree.__SourceArgs - // A dict of parameters, which gets mixed into the object - // tags: - // private - this.tree = tree; - this.node = tree.domNode; // TODO: rename; it's not a TreeNode but the whole Tree - dojo.mixin(this, params); - - // class-specific variables - this.map = {}; - this.current = null; // current TreeNode's DOM node - - // states - this.containerState = ""; - dojo.addClass(this.node, "dojoDndContainer"); - - // set up events - this.events = [ - // container level events - dojo.connect(this.node, "onmouseenter", this, "onOverEvent"), - dojo.connect(this.node, "onmouseleave", this, "onOutEvent"), - - // switching between TreeNodes - dojo.connect(this.tree, "_onNodeMouseEnter", this, "onMouseOver"), - dojo.connect(this.tree, "_onNodeMouseLeave", this, "onMouseOut"), - - // cancel text selection and text dragging - dojo.connect(this.node, "ondragstart", dojo, "stopEvent"), - dojo.connect(this.node, "onselectstart", dojo, "stopEvent") - ]; - }, - - getItem: function(/*String*/ key){ - // summary: - // Returns the dojo.dnd.Item (representing a dragged node) by it's key (id). - // Called by dojo.dnd.Source.checkAcceptance(). - // tags: - // protected - - var widget = this.selection[key], - ret = { - data: widget, - type: ["treeNode"] - }; - - return ret; // dojo.dnd.Item - }, - - destroy: function(){ - // summary: - // Prepares this object to be garbage-collected - - dojo.forEach(this.events, dojo.disconnect); - // this.clearItems(); - this.node = this.parent = null; - }, - - // mouse events - onMouseOver: function(/*TreeNode*/ widget, /*Event*/ evt){ - // summary: - // Called when mouse is moved over a TreeNode - // tags: - // protected - this.current = widget; - }, - - onMouseOut: function(/*TreeNode*/ widget, /*Event*/ evt){ - // summary: - // Called when mouse is moved away from a TreeNode - // tags: - // protected - this.current = null; - }, - - _changeState: function(type, newState){ - // summary: - // Changes a named state to new state value - // type: String - // A name of the state to change - // newState: String - // new state - var prefix = "dojoDnd" + type; - var state = type.toLowerCase() + "State"; - //dojo.replaceClass(this.node, prefix + newState, prefix + this[state]); - dojo.replaceClass(this.node, prefix + newState, prefix + this[state]); - this[state] = newState; - }, - - _addItemClass: function(node, type){ - // summary: - // Adds a class with prefix "dojoDndItem" - // node: Node - // A node - // type: String - // A variable suffix for a class name - dojo.addClass(node, "dojoDndItem" + type); - }, - - _removeItemClass: function(node, type){ - // summary: - // Removes a class with prefix "dojoDndItem" - // node: Node - // A node - // type: String - // A variable suffix for a class name - dojo.removeClass(node, "dojoDndItem" + type); - }, - - onOverEvent: function(){ - // summary: - // This function is called once, when mouse is over our container - // tags: - // protected - this._changeState("Container", "Over"); - }, - - onOutEvent: function(){ - // summary: - // This function is called once, when mouse is out of our container - // tags: - // protected - this._changeState("Container", ""); - } -}); - -} +//>>built +define("dijit/tree/_dndContainer",["dojo/aspect","dojo/_base/declare","dojo/dom-class","dojo/_base/event","dojo/_base/lang","dojo/mouse","dojo/on"],function(_1,_2,_3,_4,_5,_6,on){return _2("dijit.tree._dndContainer",null,{constructor:function(_7,_8){this.tree=_7;this.node=_7.domNode;_5.mixin(this,_8);this.current=null;this.containerState="";_3.add(this.node,"dojoDndContainer");this.events=[on(this.node,_6.enter,_5.hitch(this,"onOverEvent")),on(this.node,_6.leave,_5.hitch(this,"onOutEvent")),_1.after(this.tree,"_onNodeMouseEnter",_5.hitch(this,"onMouseOver"),true),_1.after(this.tree,"_onNodeMouseLeave",_5.hitch(this,"onMouseOut"),true),on(this.node,"dragstart",_5.hitch(_4,"stop")),on(this.node,"selectstart",_5.hitch(_4,"stop"))];},destroy:function(){var h;while(h=this.events.pop()){h.remove();}this.node=this.parent=null;},onMouseOver:function(_9){this.current=_9;},onMouseOut:function(){this.current=null;},_changeState:function(_a,_b){var _c="dojoDnd"+_a;var _d=_a.toLowerCase()+"State";_3.replace(this.node,_c+_b,_c+this[_d]);this[_d]=_b;},_addItemClass:function(_e,_f){_3.add(_e,"dojoDndItem"+_f);},_removeItemClass:function(_10,_11){_3.remove(_10,"dojoDndItem"+_11);},onOverEvent:function(){this._changeState("Container","Over");},onOutEvent:function(){this._changeState("Container","");}});}); \ No newline at end of file -- cgit v1.2.3