Browse Source

#680: fixed radio state

ios
Lebedev Konstantin 8 years ago
parent
commit
3e562a85fa
  1. 20
      Sortable.js
  2. 2
      Sortable.min.js

20
Sortable.js

@ -86,6 +86,7 @@
abs = Math.abs,
min = Math.min,
savedInputChecked = [],
touchDragOverListeners = [],
_autoScroll = _throttle(function (/**Event*/evt, /**Object*/options, /**HTMLElement*/rootEl) {
@ -214,7 +215,6 @@
;
/**
* @class Sortable
* @param {HTMLElement} el
@ -314,6 +314,9 @@
filter = options.filter,
startIndex;
_saveInputCheckedState(el);
// Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
if (dragEl) {
return;
@ -972,6 +975,11 @@
putSortable =
activeGroup =
Sortable.active = null;
savedInputChecked.forEach(function (el) {
el.checked = true;
});
savedInputChecked.length = 0;
},
handleEvent: function (/**Event*/evt) {
@ -1410,6 +1418,16 @@
);
}
function _saveInputCheckedState(root) {
var inputs = root.getElementsByTagName('input');
var idx = inputs.length;
while (idx--) {
var el = inputs[idx];
el.checked && savedInputChecked.push(el);
}
}
try {
window.addEventListener('test', null, Object.defineProperty({}, 'passive', {
get: function () {

2
Sortable.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save