-
Notifications
You must be signed in to change notification settings - Fork 2.1k
make dragndrop example work for a class not an ID. #694
Comments
My first guess would be that the events 'mouseup' and 'mousedown' are not supported on an HTMLCollection, which is what |
theres an example here: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/gettingstarted/events.md. suggests maybe it should work: var result = document.getElementById('result'); var source = Rx.Observable.fromEvent(sources, 'click'); var subscription = source.subscribe(function (e) { |
@laurencefass this was an easy fix as |
thanks matt, when you say 'easy fix' do you mean you have fixed Rx core and that thegetElementsByClassName example will now just work? |
I'm trying to adapt the drag and drop to work for a class of divs not just an ID.
https://github.com/Reactive-Extensions/RxJS/blob/master/examples/dragndrop/dragndrop.html
simple changes to give the div a class nor an ID dont work and i lose ability to drag the element
3 simple changes:
HTML line 7 i.e.
CSS line 1 i.e. .dragTarget { style attributes unchanged }
JS line 4 i.e var dragTarget = document.getElementsByClassName('dragTarget');
Im not skilled enough to know if this is a bug in RXJS or that the example is not generalised enough. The documentation on events suggests these changes should be sufficient.
The text was updated successfully, but these errors were encountered: