Ox.DocPanel: when navigating to folder in list, don't deselect it
This commit is contained in:
parent
3136c8f381
commit
9d877800b4
1 changed files with 4 additions and 3 deletions
|
@ -275,7 +275,8 @@ Ox.DocPanel = function(options, self) {
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
select: function(data) {
|
select: function(data) {
|
||||||
selectItem(
|
selectItem(
|
||||||
data.ids.length ? Ox.last(data.ids[0].split('/')) : ''
|
data.ids.length ? Ox.last(data.ids[0].split('/')) : '',
|
||||||
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -309,7 +310,7 @@ Ox.DocPanel = function(options, self) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectItem(id) {
|
function selectItem(id, fromList) {
|
||||||
var item = id ? getItemByName(id) : null;
|
var item = id ? getItemByName(id) : null;
|
||||||
if (item) {
|
if (item) {
|
||||||
self.options.selected = id;
|
self.options.selected = id;
|
||||||
|
@ -333,7 +334,7 @@ Ox.DocPanel = function(options, self) {
|
||||||
that.$element.replaceElement(1, self.$page);
|
that.$element.replaceElement(1, self.$page);
|
||||||
} else {
|
} else {
|
||||||
self.options.selected = '';
|
self.options.selected = '';
|
||||||
self.$list.options({selected: []});
|
!fromList && self.$list.options({selected: []});
|
||||||
self.$page.empty().append(self.options.element);
|
self.$page.empty().append(self.options.element);
|
||||||
}
|
}
|
||||||
that.triggerEvent('select', {id: self.options.selected});
|
that.triggerEvent('select', {id: self.options.selected});
|
||||||
|
|
Loading…
Reference in a new issue