[richfaces-svn-commits] JBoss Rich Faces SVN: r4899 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Dec 18 10:59:53 EST 2007


Author: abelevich
Date: 2007-12-18 10:59:53 -0500 (Tue, 18 Dec 2007)
New Revision: 4899

Modified:
   trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
   trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js
Log:
fix cursor management

Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js	2007-12-18 15:59:10 UTC (rev 4898)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js	2007-12-18 15:59:53 UTC (rev 4899)
@@ -373,28 +373,24 @@
 		}
 	},
 	
-	enableDraggableCursors: function() {
+	enableDraggableCursors: function(grab,grabbing) {
 			 
-		if(this.options){
-			var element = this.getElement();
+		var element = this.getElement();
 				
-			if(this.options.grab){
+		if (grab) {
+			this.dragOutBound = this.ondragout.bindAsEventListener(this);
+			this.dragOverBound = this.ondragover.bindAsEventListener(this);
+			this.dragUpBound = this.onmouseup.bindAsEventListener(this);
 				
-				this.dragOutBound = this.ondragout.bindAsEventListener(this);
-				this.dragOverBound = this.ondragover.bindAsEventListener(this);
-				this.dragUpBound = this.onmouseup.bindAsEventListener(this);
-				
-				Event.observe(element, "mouseout", this.dragOutBound);
-				Event.observe(element, "mouseover", this.dragOverBound);
-				Event.observe(element, "mouseup", this.dragUpBound);
+			Event.observe(element, "mouseout", this.dragOutBound);
+			Event.observe(element, "mouseover", this.dragOverBound);
+			Event.observe(element, "mouseup", this.dragUpBound);
 					
-				this.grabCursor = new DnD.Cursor(element,this.options.grab);
-			} 
+			this.grabCursor = new DnD.Cursor(element,grab);
+		} 
 		
-			if (this.options.grabbing) {
-				
-				this.grabbingCursor = new DnD.Cursor(document.body,this.options.grabbing);
-			}
+		if (grabbing) {
+			this.grabbingCursor = new DnD.Cursor(document.body,grabbing);
 		}
 		
 	},

Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js	2007-12-18 15:59:10 UTC (rev 4898)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js	2007-12-18 15:59:53 UTC (rev 4899)
@@ -206,13 +206,13 @@
 		}
 	},
 	
-	enableDropzoneCursors: function() {
-		if (this.options.acceptCursor) {
-			this.acceptCursor = new DnD.Cursor(this.getElement(),this.options.acceptCursor);
+	enableDropzoneCursors: function(acceptCursor, rejectCursor) {
+		if (acceptCursor) {
+			this.acceptCursor = new DnD.Cursor(this.getElement(),acceptCursor);
 		} 
 		
-		if (this.options.rejectCursor) {	
-			this.rejectCursor = new DnD.Cursor(this.getElement(),this.options.rejectCursor);
+		if (rejectCursor) {	
+			this.rejectCursor = new DnD.Cursor(this.getElement(),rejectCursor);
 		}	 
 	}, 
 




More information about the richfaces-svn-commits mailing list