Changes between Version 2 and Version 3 of DragAndDrop

Show
Ignore:
Timestamp:
10/26/05 02:56:55 (5 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DragAndDrop

    v2 v3  
    11I implemented the OpenRico Drag&Drop with MochiKit, trying to improve it a bit and adjusting it for my needs. It can be customizes easily for giving it more flexibility. 
     2 
     3It needs the following modifications in DOM.js, as seen in #4 : 
     4{{{ 
     5#!text/x-javascript 
     6MochiKit.DOM.asEventListener = function (func) { 
     7    return function (e) { 
     8        func.call(this, e || event); 
     9    }; 
     10}; 
     11 
     12MochiKit.DOM.addEventListener = function (element, action, func) { 
     13    var listener = MochiKit.DOM.asEventListener(func); 
     14    element = MochiKit.DOM.getElement(element); 
     15    if (element.addEventListener) { 
     16        element.addEventListener(action, listener, false); 
     17    } else if (element.attachEvent) { 
     18        element.attachEvent("on" + action, listener); 
     19    } 
     20    return listener; 
     21}; 
     22}}} 
    223 
    324A simple example :