From 606497fbddd7492f60e191804c1b0f3de61b1f90 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 16 Apr 2012 09:13:22 +0200 Subject: [PATCH] update DocPanel and ExamplePanel --- source/Ox.UI/js/Code/Ox.DocPanel.js | 4 +++- source/Ox.UI/js/Code/Ox.ExamplePanel.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Code/Ox.DocPanel.js b/source/Ox.UI/js/Code/Ox.DocPanel.js index 59884908..3585d29f 100644 --- a/source/Ox.UI/js/Code/Ox.DocPanel.js +++ b/source/Ox.UI/js/Code/Ox.DocPanel.js @@ -47,7 +47,7 @@ Ox.DocPanel = function(options, self) { .options(options || {}); self.$list = Ox.Element(); - self.$page = Ox.Element().append(self.options.element); + self.$page = Ox.Element(); that.setElement( self.$panel = Ox.SplitPanel({ @@ -174,6 +174,8 @@ Ox.DocPanel = function(options, self) { that.$element.replaceElement(1, self.$page); that.triggerEvent('select', {id: self.options.selected}); } + } else { + self.$page.empty().append(self.options.element); } } diff --git a/source/Ox.UI/js/Code/Ox.ExamplePanel.js b/source/Ox.UI/js/Code/Ox.ExamplePanel.js index 213f5d6f..961e1ea4 100644 --- a/source/Ox.UI/js/Code/Ox.ExamplePanel.js +++ b/source/Ox.UI/js/Code/Ox.ExamplePanel.js @@ -17,7 +17,7 @@ Ox.ExamplePanel = function(options, self) { .options(options || {}) self.$list = Ox.Element(); - self.$page = Ox.Element().append(self.options.element); + self.$page = Ox.Element(); that.setElement( self.$panel = Ox.SplitPanel({ @@ -63,6 +63,7 @@ Ox.ExamplePanel = function(options, self) { } }); self.$panel.replaceElement(0, self.$list); + selectItem(self.options.selected); that.triggerEvent('load', {}); }); @@ -108,7 +109,7 @@ Ox.ExamplePanel = function(options, self) { }) ); } else { - self.$page.empty() + self.$page.empty().append(self.options.element); } self.options.selected = id; that.triggerEvent('select', {id: id}); @@ -116,7 +117,6 @@ Ox.ExamplePanel = function(options, self) { self.setOption = function(key, value) { if (key == 'selected') { - Ox.print('SETTING LIST SELECTED TO', [value]) self.$list.options({selected: [value]}); } };