only create rightPanel if section is items

This commit is contained in:
rolux 2013-07-14 09:26:14 +00:00
parent a739033aaf
commit 3c87a63420
2 changed files with 6 additions and 11 deletions

View file

@ -14,14 +14,16 @@ pandora.ui.mainPanel = function() {
+ Ox.SYMBOLS.SHIFT + 'S</span>'
},
{
element: pandora.$ui.rightPanel = pandora.ui.rightPanel()
element: pandora.user.ui.section == 'items' ? pandora.$ui.rightPanel = pandora.ui.rightPanel()
: pandora.user.ui.section == 'edits' ? pandora.$ui.editPanel = pandora.ui.editPanel()
: pandora.$ui.textPanel = pandora.ui.textPanel()
}
],
orientation: 'horizontal'
})
.bindEvent({
pandora_edit: function(data) {
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
that.replaceElement(1, pandora.$ui.editPanel = pandora.ui.editPanel());
},
pandora_find: function() {
var previousUI = pandora.UI.getPrevious();
@ -83,7 +85,7 @@ pandora.ui.mainPanel = function() {
data.value == that.options('elements')[0].collapsed && that.toggle(0);
},
pandora_text: function(data) {
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
that.replaceElement(1, pandora.$ui.textPanel = pandora.ui.textPanel());
}
});
return that;

View file

@ -3,9 +3,7 @@
'use strict';
pandora.ui.rightPanel = function() {
var that;
if (pandora.user.ui.section == 'items') {
that = Ox.SplitPanel({
var that = Ox.SplitPanel({
elements: [
{
element: pandora.$ui.toolbar = pandora.ui.toolbar(),
@ -61,11 +59,6 @@ pandora.ui.rightPanel = function() {
}
}
});
} else if (pandora.user.ui.section == 'texts') {
that = pandora.$ui.textPanel = pandora.ui.textPanel();
} else if (pandora.user.ui.section == 'edits') {
that = pandora.$ui.editPanel = pandora.ui.editPanel();
}
return that;
};