<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,8 @@
 //  DragDropExtra Scriptaculous Enhancement, version 0.2
 //  (c) 2007-2008 Christopher Williams, Iterative Designs
 //
+// v0.4 release
+//		- Fixed issue with dragging and dropping in IE7 due to an exception being thrown and not properly reseting in FinishDrag.
 // v0.3 release
 //	  - Fixed bug found by Phillip Sauerbeck psauerbeck@gmail. Tests added based on Phillip's efforts.
 // v0.2 release
@@ -18,68 +20,68 @@
 // (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz) and available under 
 // a MIT-style license.
 
+Draggable.prototype.startDrag: function(event) {
+  this.dragging = true;
+  if(!this.delta)
+    this.delta = this.currentDelta();
+  
+  if(this.options.zindex) {
+    this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
+    this.element.style.zIndex = this.options.zindex;
+  }
+  
+  if(this.options.ghosting) {
+    this._clone = this.element.cloneNode(true);
+    this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
+    if (!this.element._originallyAbsolute)
+      Position.absolutize(this.element);
+    this.element.parentNode.insertBefore(this._clone, this.element);
+  }
+  
+	if(this.options.superghosting) {
+		Position.prepare();
+		var pointer = [Event.pointerX(event), Event.pointerY(event)];
+		body = document.getElementsByTagName(&quot;body&quot;)[0];
+		me = this.element;
+		this._clone = me.cloneNode(true);
+
+		me.parentNode.insertBefore(this._clone, me);
+		me.id = &quot;clone_&quot;+me.id;
+		me.hide();
+
+		Position.absolutize(me);
+		me.parentNode.removeChild(me);
+		body.appendChild(me);
+		//Retain height and width of object only if it has been nulled out.  -v0.3 Fix
+		if (me.style.width == &quot;0px&quot; || me.style.height == &quot;0px&quot;)	{
+		me.style.width=Element.getWidth(this._clone)+&quot;px&quot;;
+		me.style.height=Element.getHeight(this._clone)+&quot;px&quot;;
+		}
 
-Draggable.prototype.startDrag = function(event) {
-    this.dragging = true;
-    if(!this.delta)
-      this.delta = this.currentDelta();
+		//overloading in order to reduce repeated code weight.
+		this.originalScrollTop = (Element.getHeight(this._clone)/2);
 
-    if(this.options.zindex) {
-      this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
-      this.element.style.zIndex = this.options.zindex;
-    }
-    
-    if(this.options.ghosting) {
-      this._clone = this.element.cloneNode(true);
-      this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
-      if (!this.element._originallyAbsolute)
-        Position.absolutize(this.element);
-      this.element.parentNode.insertBefore(this._clone, this.element);
+		this.draw(pointer);
+		me.show();
+	}
+
+  if(this.options.scroll) {
+    if (this.options.scroll == window) {
+      var where = this._getWindowScroll(this.options.scroll);
+      this.originalScrollLeft = where.left;
+      this.originalScrollTop = where.top;
+    } else {
+      this.originalScrollLeft = this.options.scroll.scrollLeft;
+      this.originalScrollTop = this.options.scroll.scrollTop;
     }
+  }
+  
+  Draggables.notify('onStart', this, event);
+      
+  if(this.options.starteffect) this.options.starteffect(this.element);
+}
 
-	
-    if(this.options.superghosting) {
-			Position.prepare();
-			var pointer = [Event.pointerX(event), Event.pointerY(event)];
-			body = document.getElementsByTagName(&quot;body&quot;)[0];
-			me = this.element;
-			this._clone = me.cloneNode(true);
-
-			me.parentNode.insertBefore(this._clone, me);
-			me.id = &quot;clone_&quot;+me.id;
-			me.hide();
-
-			Position.absolutize(me);
-			me.parentNode.removeChild(me);
-			body.appendChild(me);
-			//Retain height and width of object only if it has been nulled out.  -v0.3 Fix
-			if (me.style.width == &quot;0px&quot; || me.style.height == &quot;0px&quot;)	{
-				me.style.width=Element.getWidth(this._clone)+&quot;px&quot;;
-				me.style.height=Element.getHeight(this._clone)+&quot;px&quot;;
-			}
-
-			//overloading in order to reduce repeated code weight.
-			this.originalScrollTop = (Element.getHeight(this._clone)/2);
-
-			this.draw(pointer);
-			me.show();
-		}
 
-		if(this.options.scroll) {
-		  if (this.options.scroll == window) {
-		    var where = this._getWindowScroll(this.options.scroll);
-		    this.originalScrollLeft = where.left;
-		    this.originalScrollTop = where.top;
-		  } else {
-		    this.originalScrollLeft = this.options.scroll.scrollLeft;
-		    this.originalScrollTop = this.options.scroll.scrollTop;
-		  }
-		}
-    
-    Draggables.notify('onStart', this, event);
-        
-    if(this.options.starteffect) this.options.starteffect(this.element);
-}
 
 
 Draggable.prototype.draw = function(point) {
@@ -131,7 +133,29 @@ Draggable.prototype.draw = function(point) {
     if(style.visibility==&quot;hidden&quot;) style.visibility = &quot;&quot;; // fix gecko rendering
 }
 
-Droppables.isAffected = function(point, element, drop) {
+Draggables.prototype.initDrag: function(event) {
+  if(!Object.isUndefined(Draggable._dragging[this.element]) &amp;&amp;
+    Draggable._dragging[this.element]) return;
+  if(Event.isLeftClick(event)) {    
+    // abort on form elements, fixes a Firefox issue
+    var src = Event.element(event);
+    if((tag_name = src.tagName.toUpperCase()) &amp;&amp; (
+      tag_name=='INPUT' ||
+      tag_name=='SELECT' ||
+      tag_name=='OPTION' ||
+      tag_name=='BUTTON' ||
+      tag_name=='TEXTAREA')) return;
+      
+    var pointer = [Event.pointerX(event), Event.pointerY(event)];
+    var pos     = Position.cumulativeOffset(this.element);
+    this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
+    
+    Draggables.activate(this);
+    Event.stop(event);
+  }
+}
+
+Droppables.prototype.isAffected = function(point, element, drop) {
 	Position.prepare();
 	positioned_within = Position.withinIncludingScrolloffsets(drop.element, point[0], point[1])
 	return (
@@ -145,8 +169,7 @@ Droppables.isAffected = function(point, element, drop) {
 
 }
 
-
-Draggable.prototype.finishDrag =  function(event, success) {
+Draggable.prototype.finishDrag: function(event, success) {
   this.dragging = false;
   
   if(this.options.quiet){
@@ -156,25 +179,13 @@ Draggable.prototype.finishDrag =  function(event, success) {
   }
 
   if(this.options.ghosting) {
-      if (!this.element._originallyAbsolute)
-        Position.relativize(this.element);
-      delete this.element._originallyAbsolute;
-      Element.remove(this._clone);
-      this._clone = null;
+    if (!this.element._originallyAbsolute)
+      Position.relativize(this.element);
+    delete this.element._originallyAbsolute;
+    Element.remove(this._clone);
+    this._clone = null;
   }
 
-	
-	
-  if(this.options.superghosting) {
-	  body = document.getElementsByTagName(&quot;body&quot;)[0];
-      Element.remove(this.element);
-/*
-	  me = this.element;
-	  body.removeChild(me);
-*/
-	  new Draggable(this._clone, this.options);
-	}
-
   var dropped = false; 
   if(success) { 
     dropped = Droppables.fire(event, this.element); 
@@ -184,7 +195,7 @@ Draggable.prototype.finishDrag =  function(event, success) {
   Draggables.notify('onEnd', this, event);
 
   var revert = this.options.revert;
-  if(revert &amp;&amp; typeof revert == 'function') revert = revert(this.element);
+  if(revert &amp;&amp; Object.isFunction(revert)) revert = revert(this.element);
   
   var d = this.currentDelta();
   if(revert &amp;&amp; this.options.reverteffect) {
@@ -201,6 +212,15 @@ Draggable.prototype.finishDrag =  function(event, success) {
   if(this.options.endeffect) 
     this.options.endeffect(this.element);
     
+
+	if(this.options.superghosting) {
+		body = document.getElementsByTagName(&quot;body&quot;)[0];
+	  Element.remove(this.element);
+		new Draggable(this._clone, this.options);
+	}
+
+
   Draggables.deactivate(this);
   Droppables.reset();
 }
+</diff>
      <filename>dragdropextra.js</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>tests/index.html</filename>
    </removed>
    <removed>
      <filename>tests/index2.html</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0f6d58469c33c2236157b7ef4562c6d1c7598bad</id>
    </parent>
  </parents>
  <author>
    <name>Chris Williams</name>
    <email>chris@iterativedesigns.com</email>
  </author>
  <url>http://github.com/voodootikigod/dragdropextra/commit/8cd3555d9bb72009d260f4176a029b419398cb2c</url>
  <id>8cd3555d9bb72009d260f4176a029b419398cb2c</id>
  <committed-date>2008-06-14T13:52:53-07:00</committed-date>
  <authored-date>2008-06-14T13:52:53-07:00</authored-date>
  <message>Fixing the tests</message>
  <tree>9e6d1e1cc10ca423282e93461a67782fbf1830ae</tree>
  <committer>
    <name>Chris Williams</name>
    <email>chris@iterativedesigns.com</email>
  </committer>
</commit>
