Ox.List: set item.options('position'), not item.data('position')

This commit is contained in:
rlx 2013-07-14 13:41:02 +00:00
parent a7cdb3af3d
commit c8d0969a41

View file

@ -964,17 +964,15 @@ Ox.List = function(options, self) {
}
function moveend(data) {
var $item = self.$items[self.drag.pos];
$item.removeClass('OxDrag')
self.$items[self.drag.pos]
.removeClass('OxDrag')
.css({
cursor: 'default'
});
that.triggerEvent('move', {
//id: id,
ids: self.$items.map(function($item) {
return $item.options('data')[self.options.unique];
})
//position: pos
});
delete self.drag;
}
@ -987,7 +985,7 @@ Ox.List = function(options, self) {
var $item = self.$items.splice(startPos, 1)[0];
self.$items.splice(stopPos, 0, $item);
self.$items.forEach(function($item, pos) {
$item.data({position: pos});
$item.options({position: pos});
});
self.selected = [stopPos];
}
@ -1389,8 +1387,8 @@ Ox.List = function(options, self) {
}
function updatePositions() {
self.$items.forEach(function(item, pos) {
item.data('position', pos);
self.$items.forEach(function($item, pos) {
$item.options({position: pos});
});
}