Browse Source

#718: * fixed context in 'add' & 'sort' events

pull/727/head
RubaXa 9 years ago
parent
commit
7f3ee38b16
  1. 4
      README.md
  2. 6
      Sortable.js

4
README.md

@ -155,7 +155,7 @@ You can also define whether lists can give away, give and keep a copy (`clone`),
Demo:
- http://jsbin.com/naduvo/edit?js,output
- http://jsbin.com/tisequvute/edit?js,output — use of complex logic in the `pull` and` put`
- http://jsbin.com/rusuvot/edit?js,output — use of complex logic in the `pull` and` put`
---
@ -347,7 +347,7 @@ The speed at which the window should scroll once the mouse pointer gets within t
---
### Event object
### Event object ([demo](http://jsbin.com/xedusu/edit?js,output))
- to:`HTMLElement` — list, in which moved element.
- from:`HTMLElement` — previous list

6
Sortable.js

@ -156,7 +156,7 @@
_prepareGroup = function (options) {
function toFn(value, pull) {
if (value === void 0) {
value = true;
value = group.name;
}
if (typeof value === 'function') {
@ -1118,8 +1118,10 @@
function _dispatchEvent(sortable, rootEl, name, targetEl, fromEl, startIndex, newIndex) {
sortable = (sortable || rootEl[expando]);
var evt = document.createEvent('Event'),
options = (sortable || rootEl[expando]).options,
options = sortable.options,
onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
evt.initEvent(name, true, true);

Loading…
Cancel
Save