Skip to content

Commit

Permalink
[giow] (3) Make sure that if you cancel a drag-and-drop operation, we…
Browse files Browse the repository at this point in the history
… reset the current drag operation to 'none' so that you can tell in the dragend event.

Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@8143 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 13, 2013
1 parent ec7752b commit 39a41ab
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
13 changes: 9 additions & 4 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 12 August 2013</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 13 August 2013</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -76855,8 +76855,10 @@ <h4 id=introduction-8><span class=secno>8.7.1 </span>Introduction</h4>
// <em>...as before...</em>
}
function dragEndHandler(event) {
// remove the dragged element
event.target.parentNode.removeChild(event.target);
if (event.dataTransfer.dropEffect == 'move') {
// remove the dragged element
event.target.parentNode.removeChild(event.target);
}
}
&lt;/script&gt;</pre>

Expand Down Expand Up @@ -78383,7 +78385,9 @@ <h4 id=drag-and-drop-processing-model><span class=secno>8.7.5 </span>Drag-and-dr

<li><p>If the <a href=#current-target-element>current target element</a> is a DOM element, <a href=#fire-a-dnd-event>fire a DND
event</a> named <code title=event-dragleave><a href=#event-dragleave>dragleave</a></code> at it; otherwise, if it is
not null, use platform-specific conventions for drag cancellation.</p>
not null, use platform-specific conventions for drag cancellation.</li>

<li><p>Set the <a href=#current-drag-operation>current drag operation</a> to "<code title="">none</code>".</li>

</ol><p>Otherwise, the drag operation might be a success; run these substeps:</p>

Expand Down Expand Up @@ -103293,6 +103297,7 @@ <h2 class=no-num id=references>References</h2><!--REFS-->
Daniel Schattenkirchner,
Daniel Sp&aring;ng,
Daniel Steinberg,
Daniel Trebbien,
Danny Sullivan,
Darin Adler,
Darin Fisher,
Expand Down
13 changes: 9 additions & 4 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@

<header class=head id=head><p><a href=http://www.whatwg.org/ class=logo><img width=101 src=/images/logo alt=WHATWG height=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 12 August 2013</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 13 August 2013</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
Expand Down Expand Up @@ -76855,8 +76855,10 @@ addShortcutKeyLabel(document.getElementById('c'));</pre>
// <em>...as before...</em>
}
function dragEndHandler(event) {
// remove the dragged element
event.target.parentNode.removeChild(event.target);
if (event.dataTransfer.dropEffect == 'move') {
// remove the dragged element
event.target.parentNode.removeChild(event.target);
}
}
&lt;/script&gt;</pre>

Expand Down Expand Up @@ -78383,7 +78385,9 @@ dictionary <dfn id=drageventinit>DragEventInit</dfn> : <a href=#mouseeventinit>M

<li><p>If the <a href=#current-target-element>current target element</a> is a DOM element, <a href=#fire-a-dnd-event>fire a DND
event</a> named <code title=event-dragleave><a href=#event-dragleave>dragleave</a></code> at it; otherwise, if it is
not null, use platform-specific conventions for drag cancellation.</p>
not null, use platform-specific conventions for drag cancellation.</li>

<li><p>Set the <a href=#current-drag-operation>current drag operation</a> to "<code title="">none</code>".</li>

</ol><p>Otherwise, the drag operation might be a success; run these substeps:</p>

Expand Down Expand Up @@ -103293,6 +103297,7 @@ if (s = prompt('What is your name?')) {
Daniel Schattenkirchner,
Daniel Sp&aring;ng,
Daniel Steinberg,
Daniel Trebbien,
Danny Sullivan,
Darin Adler,
Darin Fisher,
Expand Down
11 changes: 8 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -86095,8 +86095,10 @@ addShortcutKeyLabel(document.getElementById('c'));</pre>
// <em>...as before...</em>
}
function dragEndHandler(event) {
// remove the dragged element
event.target.parentNode.removeChild(event.target);
if (event.dataTransfer.dropEffect == 'move') {
// remove the dragged element
event.target.parentNode.removeChild(event.target);
}
}
&lt;/script></pre>

Expand Down Expand Up @@ -87944,7 +87946,9 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {

<li><p>If the <span>current target element</span> is a DOM element, <span>fire a DND
event</span> named <code title="event-dragleave">dragleave</code> at it; otherwise, if it is
not null, use platform-specific conventions for drag cancellation.</p>
not null, use platform-specific conventions for drag cancellation.</p></li>

<li><p>Set the <span>current drag operation</span> to "<code title="">none</code>".</p></li>

</ol>

Expand Down Expand Up @@ -115779,6 +115783,7 @@ if (s = prompt('What is your name?')) {
Daniel Schattenkirchner,
Daniel Sp&aring;ng,
Daniel Steinberg,
Daniel Trebbien,
Danny Sullivan,
Darin Adler,
Darin Fisher,
Expand Down

0 comments on commit 39a41ab

Please sign in to comment.