Custom Query (18300 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (208 - 210 of 18300)

Ticket Resolution Summary Owner Reporter
#5859 patchwelcome [patch][cla] dnd patch for nested targets Eugene Lazutkin Brett Gardner
Description

A patch to allow nested targets in drag and drop. The nested targets can accept different source types. eg I had a setup where a Page can contain Sections. A Section can contain more Sections or Questions.

Index: dnd/Manager.js
===================================================================
--- dnd/Manager.js	(revision 12205)
+++ dnd/Manager.js	(working copy)
@@ -14,6 +14,9 @@
 		this.target = null;
 		this.canDropFlag = false;
 		this.events = [];
+		this.nestedTargets = false;
+		this.sources = new dojo.NodeList();
+		this.leftSource = false;
 	},
 
 	// avatar's offset from the mouse
@@ -159,6 +162,17 @@
 		this.updateAvatar();
 		dojo.removeClass(dojo.body(), "dojoDnd" + (this.copy ? "Move" : "Copy"));
 		dojo.addClass(dojo.body(), "dojoDnd" + (this.copy ? "Copy" : "Move"));
+	},
+	registerSource: function(source){
+		this.sources.push(source);
+	},
+	sourceById: function(id){
+		for (var i = 0; i < this.sources.length; i++){
+			if (this.sources[i].node.id == id){
+				return this.sources[i];
+			}
+		}
+		return null;
 	}
 });
 
Index: dnd/Source.js
===================================================================
--- dnd/Source.js	(revision 12205)
+++ dnd/Source.js	(working copy)
@@ -78,6 +78,9 @@
 			dojo.subscribe("/dnd/drop",   this, "onDndDrop"),
 			dojo.subscribe("/dnd/cancel", this, "onDndCancel")
 		];
+
+		var m = dojo.dnd.manager();
+		m.registerSource(this); //nestedTargets will be set by the client after this so always register the source
 	},
 	
 	// methods
@@ -129,6 +132,13 @@
 		dojo.dnd.Source.superclass.onMouseMove.call(this, e);
 		var m = dojo.dnd.manager();
 		if(this.isDragging){
+            
+			if (m.leftSource){
+				m.leftSource = false;
+				m.overSource(this);
+				return;
+			}
+
 			// calculate before/after
 			var before = false;
 			if(this.current){
@@ -210,8 +220,27 @@
 		// source: Object: the source which provides items
 		// nodes: Array: the list of transferred items
 		// copy: Boolean: copy items, if true, move items otherwise
+        
+		var m = dojo.dnd.manager();
+
 		do{ //break box
 			if(this.containerState != "Over"){ break; }
+
+			/*If this source, contains any sources itself that have
+			their "containerState" set to "Over" then break*/
+			if (m.nestedTargets){
+				var sources = m.sources;
+				if (dojo.some(sources,function(item){
+					return Boolean(
+					item.node.id != this.node.id
+					&& item.containerState == 'Over'
+					&& dojo.isDescendant(item.node,this.node)
+				);
+				},this)){
+					break;
+				}
+			}
+            
 			var oldCreator = this._normalizedCreator;
 			if(this != source){
 				// transferring nodes from the source to the target
@@ -314,6 +343,10 @@
 	},
 	onOutEvent: function(){
 		// summary: this function is called once, when mouse is out of our container
+		var m = dojo.dnd.manager();
+		if (m.nestedTargets){
+			m.leftSource = true;
+		}
 		dojo.dnd.Source.superclass.onOutEvent.call(this);
 		dojo.dnd.manager().outSource(this);
 	},
#237 fixed in build.xml, the property "copyright" needs (1) a line feed, and maybe (2) a mention of the BSD license anonymous Brian Douglas Skinner <[email protected]…>
Description

In the dojo-0.1.0 release, the files in zip-file "editions" had single-line copyright statements at the top of every source file: /* Copyright (c) 2004-2005 The Dojo Foundation, Licensed under the Academic Free License version 2.1 or above */

In dojo-0.1.0 that copyright line was missing a line feed at the end, which made it hard to read the code. For example, the beginning of the src extString.js file looked like this:

/* Copyright (c) 2004-2005 The Dojo Foundation, Licensed under the Academic Free License version 2.1 or above */dojo.provide("dojo.text.String");

It would be better if it looked like this: /* Copyright (c) 2004-2005 The Dojo Foundation, Licensed under the Academic Free License version 2.1 or above */ dojo.provide("dojo.text.String");

Or, better still: /* Copyright (c) 2004-2005 The Dojo Foundation, Licensed under the Academic Free License version 2.1 or above */

dojo.provide("dojo.text.String");

Probably that line of text needs to get changed for release 0.2.0 anyway, to mention BSD as well as AFL. It'd be easy to add in the line feed character at the same time.

I think the place to make the change is line 37 in buildscriptsuild.xml

#262 fixed make sure dojo.hostenv.* methods are deprecated James Burke Brian Douglas Skinner <[email protected]…>
Description

background:

dojo.hostenv.conditionalLoadModule() has been superceded by dojo.kwCompoundRequire(), but there doesn't seem to be a new replacement for dojo.hostenv.moduleLoaded()

possible tasks:

  • create a dojo.moduleLoaded() (or something like it) to replace dojo.hostenv.moduleLoaded()
  • mark dojo.hostenv.moduleLoaded() as dojo.deprecated()
  • mark dojo.hostenv.conditionalLoadModule() as dojo.deprecated()
  • make sure there aren't other dojo.hostenv.* that still need to be deprecated
Note: See TracQuery for help on using queries.