1
0
Fork 0
forked from 0x2620/oxjs

update infolist

This commit is contained in:
rlx 2011-10-17 10:23:16 +00:00
commit 5d669f42e3
4 changed files with 60 additions and 38 deletions

View file

@ -686,6 +686,18 @@ Ox.List = function(options, self) {
return self.selected.indexOf(pos) > -1;
}
function isSpecialTarget(e) {
var $element = $(e.target),
$parent;
while (
!$element.is('.OxSpecialTarget') && !$element.is('.OxPage')
&& ($parent = $element.parent()).length
) {
$element = $parent;
}
return $element.is('.OxSpecialTarget');
}
function loadItems() {
self.$pages[0].empty();
self.$items = [];
@ -885,9 +897,10 @@ Ox.List = function(options, self) {
}
function doubleclick(data) {
open();
open(isSpecialTarget(data));
}
/*
function _mousedown(e) { // fixme: no longer used, remove
var pos = findItemPosition(e),
clickable, editable,
@ -970,6 +983,7 @@ Ox.List = function(options, self) {
selectNone();
}
}
*/
function moveItem(startPos, stopPos) {
var $item = self.$items[startPos],
@ -984,9 +998,10 @@ Ox.List = function(options, self) {
self.selected = [stopPos];
}
function open() {
function open(isSpecialTarget) {
self.options.selected.length && that.triggerEvent('open', {
ids: self.options.selected
ids: self.options.selected,
isSpecialTarget: isSpecialTarget == true
});
}