Skip to content

Commit

Permalink
[#7] propagate element correctly - rather than capturing and the drop…
Browse files Browse the repository at this point in the history
…ping it on the floor :)
  • Loading branch information
timruffles committed Oct 28, 2013
1 parent 333a6a7 commit 906cc2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 4 additions & 1 deletion demo/index.html
Expand Up @@ -82,12 +82,15 @@ <h1>iOS shim for HTML5 Drag and drop</h1>
<p>Drag the list items over the dustbin, and drop them to have the bin eat the item</p>
<div id="bin"></div>
<ul>
<li><a id="one" href="#">one</a></li>
<li><a id="one" href="#"><span style="display: inline-block; background: lightblue">one</span></a></li>
<li><a href="#" id="two">two</a></li>
<li><a href="#" id="three">three</a></li>
<li><a href="#" id="four">four</a></li>
<li><a href="#" id="five">five</a></li>
</ul>
<h4>Notes</h2>
<ol>
<li>The blue bordered item ('one') is a child inside a draggable element. If you drag the child, we should still drag the whole element.</li>
</article>
<script>

Expand Down
7 changes: 1 addition & 6 deletions ios-drag-drop.js
Expand Up @@ -148,17 +148,12 @@
}

// event listeners
function dragstart(evt) {
evt.preventDefault();
new DragDrop(evt);
}

function touchstart(evt) {
var el = evt.target;
do {
if (el.hasAttribute("draggable")) {
evt.preventDefault();
return dragstart(evt, el);
new DragDrop(evt,el);
}
} while((el = el.parentNode) && el != doc.body)
}
Expand Down

0 comments on commit 906cc2b

Please sign in to comment.