]> git.mjollnir.org Git - moodle.git/commitdiff
Removed frame around draggable blocks and fixed 'short drag' bug.
authorcap2501 <cap2501>
Mon, 28 Aug 2006 04:33:41 +0000 (04:33 +0000)
committercap2501 <cap2501>
Mon, 28 Aug 2006 04:33:41 +0000 (04:33 +0000)
lib/ajax/block_classes.js

index b6e1f7b776f3f67d293168eece7559595385e985..6b7c9cfdc6cc4c65bad82f2339f29b2a1c999058 100644 (file)
@@ -66,6 +66,7 @@ block_class.prototype.startDrag = function(x, y) {
     dragEl.className = clickEl.className;
     dragEl.style.color = this.DDM.getStyle(clickEl, "color");;
     dragEl.style.backgroundColor = this.DDM.getStyle(clickEl, "backgroundColor");
+    dragEl.style.border = '0px';
 
     var s = clickEl.style;
     s.opacity = .1;
@@ -103,6 +104,7 @@ block_class.prototype.onDragDrop = function(e, id) {
         oDD = YAHOO.util.DDM.getBestMatch(id);
     }
 
+    
     var el = this.getEl();
 
     YAHOO.log("id="+id+" el = "+e+" x="+YAHOO.util.Dom.getXY(this.getDragEl()));
@@ -150,6 +152,11 @@ block_class.prototype.move_block = function(columnid){
 
         if(this.debug && inserttarget != null)YAHOO.log("moving "+this.getEl().id+" before "+inserttarget.getEl().id+" - parentNode="+this.getEl().parentNode.id);
         
+        if(this == inserttarget){
+            if(this.debug)YAHOO.log("Dropping on self, resetting");
+            this.endDrag();
+            return;
+        }
         
         //remove from document        
         if(this.getEl().parentNode != null)