fix the tree list disclosure triangle bug
This commit is contained in:
parent
60165632c5
commit
c589594e8e
2 changed files with 8 additions and 13 deletions
|
@ -6,6 +6,8 @@ Ox.load.Geo = function(options, callback) {
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
Ox.COUNTRIES <[o]> Array of countries
|
Ox.COUNTRIES <[o]> Array of countries
|
||||||
|
See http://en.wikipedia.org/wiki/List_of_sovereign_states,
|
||||||
|
http://en.wikipedia.org/wiki/ISO_3166-3 and http://www.imdb.com/country/
|
||||||
area <n> Area of the country in square meters
|
area <n> Area of the country in square meters
|
||||||
code <s> ISO 3166 country code
|
code <s> ISO 3166 country code
|
||||||
dependencies <[s]> Array of dependencies of the country (country codes)
|
dependencies <[s]> Array of dependencies of the country (country codes)
|
||||||
|
|
|
@ -45,11 +45,11 @@ Ox.TreeList = function(options, self) {
|
||||||
function clickItem(e) {
|
function clickItem(e) {
|
||||||
var $target = $(e.target),
|
var $target = $(e.target),
|
||||||
$item, id, item;
|
$item, id, item;
|
||||||
if ($target.hasClass('OxToggle')) {
|
if ($target.is('.OxToggle')) {
|
||||||
$item = $target.parent().parent();
|
$item = $target.parent().parent();
|
||||||
id = $item.data('id');
|
id = $item.data('id');
|
||||||
item = getItemById(id);
|
item = getItemById(id);
|
||||||
toggleItem(item, !item.expanded)
|
toggleItem(item, !item.expanded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,16 +160,16 @@ Ox.TreeList = function(options, self) {
|
||||||
function toggleItem(item, expanded) {
|
function toggleItem(item, expanded) {
|
||||||
var $img, pos;
|
var $img, pos;
|
||||||
item.expanded = expanded;
|
item.expanded = expanded;
|
||||||
|
getItemById(item.id).expanded = expanded;
|
||||||
|
Ox.print('>>>>', getItemById(item.id))
|
||||||
$.each(that.$element.find('.OxItem'), function(i, v) {
|
$.each(that.$element.find('.OxItem'), function(i, v) {
|
||||||
var $item = $(v);
|
var $item = $(v);
|
||||||
if ($item.data('id') == item.id) {
|
if ($item.data('id') == item.id) {
|
||||||
$img = $item.find('img');
|
$img = $item.find('.OxToggle');
|
||||||
pos = $item.data('position');
|
pos = $item.data('position');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Ox.print('i.e', item.expanded, $img, $img.attr('src'));
|
|
||||||
// FIXME: why does this not work??
|
|
||||||
///*
|
///*
|
||||||
$img.attr({
|
$img.attr({
|
||||||
src: Ox.UI.getImagePath(
|
src: Ox.UI.getImagePath(
|
||||||
|
@ -177,14 +177,7 @@ Ox.TreeList = function(options, self) {
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
//*/
|
//*/
|
||||||
/*
|
that.$element.value(item.id, 'expanded', expanded);
|
||||||
Ox.print($img.attr('src'))
|
|
||||||
$img.attr({
|
|
||||||
src: $img.attr('src') == Ox.UI.getImagePath('symbolDown.svg') ?
|
|
||||||
Ox.UI.getImagePath('symbolRight.svg') :
|
|
||||||
Ox.UI.getImagePath('symbolDown.svg')
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
item.expanded ?
|
item.expanded ?
|
||||||
that.$element.addItems(pos + 1, parseItems(item.items, item.level + 1)) :
|
that.$element.addItems(pos + 1, parseItems(item.items, item.level + 1)) :
|
||||||
that.$element.removeItems(pos + 1, parseItems(item.items, item.level + 1).length);
|
that.$element.removeItems(pos + 1, parseItems(item.items, item.level + 1).length);
|
||||||
|
|
Loading…
Reference in a new issue