This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9756 - <p>What fruits do you like?</p> <ol ondragstart="dragStartHandler(event)"> <li draggable data-value="fruit-apple">Apples</li> <li draggable data-value="fruit-orange">Oranges</li> <li draggable data-value="fruit-pear">Pears</li> </ol> <script> var int
Summary: <p>What fruits do you like?</p> <ol ondragstart="dragStartHandler(event)"> <...
Status: VERIFIED INVALID
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 05:00 UTC by contributor
Modified: 2010-10-09 15:20 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2010-05-18 05:00:39 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#introduction-5

Comment:
<p>What fruits do you like?</p> <ol ondragstart="dragStartHandler(event)"> 
<li draggable data-value="fruit-apple">Apples</li>  <li draggable
data-value="fruit-orange">Oranges</li>	<li draggable
data-value="fruit-pear">Pears</li> </ol> <script>   var internalDNDType =
'text/x-example'; // set this to something specific to your site   function
dragStartHandler(event) {     if (event.target instanceof HTMLLIElement) {    
  // use the element's data-value="" attribute as the value to be moving:     
 event.dataTransfer.setData(internalDNDType, event.target.dataset.value);     
 event.effectAllowed = 'move'; // only allow moves     } else {      
event.preventDefault(); // don't allow selection to be dragged	   }   }
</script>

Posted from: 202.70.51.124
Comment 1 Michael[tm] Smith 2010-05-18 05:46:07 UTC
not a bug report