forked from 0x2620/oxjs
fixing a bug where in a list, the click target loop would not exit when items are added or removed on click
This commit is contained in:
parent
5efe54c0e2
commit
c3b59a62fe
8 changed files with 71 additions and 22 deletions
|
|
@ -53,8 +53,8 @@ Ox.TreeList = function(options, self) {
|
|||
.css({
|
||||
width: self.options.width + 'px'
|
||||
})
|
||||
.click(clickItem)
|
||||
.bindEvent({
|
||||
anyclick: clickItem,
|
||||
toggle: toggleItems
|
||||
});
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ Ox.TreeList = function(options, self) {
|
|||
},
|
||||
type = Ox.typeOf(value);
|
||||
if (type == 'array' || type == 'object') {
|
||||
ret.title += Ox.toTitleCase(type);
|
||||
ret.title += Ox.toTitleCase(type) + ' [' + Ox.len(value) + ']';
|
||||
ret.items = Ox.map(Ox.sort(Ox.keys(value)), function(k) {
|
||||
return parseData(k, value[k]);
|
||||
});
|
||||
|
|
@ -177,8 +177,8 @@ Ox.TreeList = function(options, self) {
|
|||
var $img, pos;
|
||||
item.expanded = expanded;
|
||||
//getItemById(item.id).expanded = expanded;
|
||||
$.each(that.$element.find('.OxItem'), function(i, v) {
|
||||
var $item = $(v);
|
||||
$.each(that.$element.find('.OxItem'), function() {
|
||||
var $item = $(this);
|
||||
if ($item.data('id') == item.id) {
|
||||
$img = $item.find('.OxToggle');
|
||||
pos = $item.data('position');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue