From 9d877800b46c5a6def191db9bc0e9832c39bb4d7 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 13 Jun 2012 12:08:54 +0200 Subject: [PATCH] Ox.DocPanel: when navigating to folder in list, don't deselect it --- source/Ox.UI/js/Code/DocPanel.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Code/DocPanel.js b/source/Ox.UI/js/Code/DocPanel.js index 9fcd7f4e..01140a9d 100644 --- a/source/Ox.UI/js/Code/DocPanel.js +++ b/source/Ox.UI/js/Code/DocPanel.js @@ -275,7 +275,8 @@ Ox.DocPanel = function(options, self) { .bindEvent({ select: function(data) { 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; if (item) { self.options.selected = id; @@ -333,7 +334,7 @@ Ox.DocPanel = function(options, self) { that.$element.replaceElement(1, self.$page); } else { self.options.selected = ''; - self.$list.options({selected: []}); + !fromList && self.$list.options({selected: []}); self.$page.empty().append(self.options.element); } that.triggerEvent('select', {id: self.options.selected});