pandora/static/js/contentPanel.js

61 lines
2.4 KiB
JavaScript
Raw Normal View History

2011-07-29 18:37:11 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2011-11-05 17:04:10 +00:00
'use strict';
2011-05-25 19:42:45 +00:00
pandora.ui.contentPanel = function() {
2011-06-19 17:49:25 +00:00
var that = Ox.SplitPanel({
elements: !pandora.user.ui.item ? [
{
2011-11-06 08:28:10 +00:00
collapsed: !pandora.user.ui.showFilters,
collapsible: true,
element: pandora.$ui.browser = pandora.ui.browser(),
resizable: true,
resize: [96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256],
2011-11-06 08:28:10 +00:00
size: pandora.user.ui.filtersSize,
2014-02-14 15:23:59 +00:00
tooltip: Ox._('filters') + ' <span class="OxBright">'
+ Ox.SYMBOLS.SHIFT + 'F</span>'
},
{
element: pandora.$ui.list = pandora.ui.list()
2011-11-06 19:42:34 +00:00
},
{
element: pandora.$ui.statusbar = pandora.ui.statusbar(),
size: 16
}
] : [
{
collapsed: !pandora.user.ui.showBrowser,
collapsible: true,
element: pandora.$ui.browser = pandora.ui.browser(),
size: 112 + Ox.UI.SCROLLBAR_SIZE,
2014-02-14 15:23:59 +00:00
tooltip: Ox._('{0} browser', [Ox._(pandora.site.itemName.singular.toLowerCase())])
+ ' <span class="OxBright">'
+ Ox.SYMBOLS.SHIFT + 'B</span>'
},
{
element: pandora.$ui.item = pandora.ui.item()
}
],
orientation: 'vertical'
})
.bindEvent({
pandora_item: function(data) {
if (data.value && data.previousValue) {
that.replaceElement(1, pandora.$ui.item = pandora.ui.item());
}
2011-05-25 19:42:45 +00:00
},
pandora_itemview: function() {
pandora.user.ui.item && that.replaceElement(1, pandora.$ui.item = pandora.ui.item());
},
2012-02-01 12:01:39 +00:00
pandora_listview: function() {
!pandora.user.ui.item && that.replaceElement(1, pandora.$ui.list = pandora.ui.list());
2012-02-01 12:01:39 +00:00
},
pandora_showbrowser: function(data) {
data.value == that.options('elements')[0].collapsed && that.toggle(0);
},
2011-11-06 08:28:10 +00:00
pandora_showfilters: function(data) {
data.value == that.options('elements')[0].collapsed && that.toggle(0);
2011-09-27 22:12:37 +00:00
}
});
2011-05-25 19:42:45 +00:00
return that;
};