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.mainPanel = function() {
|
2011-06-19 17:49:25 +00:00
|
|
|
var that = Ox.SplitPanel({
|
2011-09-27 23:30:13 +00:00
|
|
|
elements: [
|
|
|
|
{
|
|
|
|
collapsible: true,
|
|
|
|
collapsed: !pandora.user.ui.showSidebar,
|
|
|
|
element: pandora.$ui.leftPanel = pandora.ui.leftPanel(),
|
|
|
|
resizable: true,
|
|
|
|
resize: [192, 256, 320, 384],
|
|
|
|
size: pandora.user.ui.sidebarSize,
|
2011-10-13 10:12:00 +00:00
|
|
|
tooltip: 'sidebar'
|
2011-09-27 23:30:13 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
element: pandora.$ui.rightPanel = pandora.ui.rightPanel()
|
|
|
|
}
|
|
|
|
],
|
|
|
|
orientation: 'horizontal'
|
|
|
|
})
|
|
|
|
.bindEvent({
|
|
|
|
pandora_find: function() {
|
|
|
|
var previousUI = pandora.UI.getPrevious();
|
2011-11-02 02:45:03 +00:00
|
|
|
if (!previousUI.item && pandora.user.ui._list == previousUI._list) {
|
2011-10-08 18:36:26 +00:00
|
|
|
if (['map', 'calendar'].indexOf(pandora.user.ui.listView) > -1) {
|
|
|
|
pandora.$ui.contentPanel.replaceElement(1,
|
|
|
|
pandora.ui.navigationView(pandora.user.ui.listView)
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
pandora.$ui.list.reloadList();
|
|
|
|
}
|
2011-11-05 21:13:54 +00:00
|
|
|
// FIXME: why is this being handled _here_?
|
2011-11-06 08:28:10 +00:00
|
|
|
pandora.user.ui._filterState.forEach(function(data, i) {
|
|
|
|
if (!Ox.isEqual(data.selected, previousUI._filterState[i].selected)) {
|
|
|
|
pandora.$ui.filters[i].options({selected: data.selected});
|
2011-09-27 23:30:13 +00:00
|
|
|
}
|
2011-11-06 08:28:10 +00:00
|
|
|
if (!Ox.isEqual(data.find, previousUI._filterState[i].find)) {
|
|
|
|
Ox.print(i, 'NOT EQUAL', data.find, previousUI._filterState[i].find)
|
|
|
|
pandora.$ui.filters[i].reloadList();
|
2011-11-05 21:13:54 +00:00
|
|
|
} else {
|
2011-11-06 08:28:10 +00:00
|
|
|
Ox.print(i, 'EQUAL', data.find, previousUI._filterState[i].find)
|
2011-10-29 17:46:46 +00:00
|
|
|
}
|
2011-09-27 23:30:13 +00:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
|
|
|
|
}
|
2011-05-25 19:42:45 +00:00
|
|
|
},
|
2011-09-27 23:30:13 +00:00
|
|
|
pandora_item: function(data) {
|
|
|
|
if (!data.value || !data.previousValue) {
|
|
|
|
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
|
|
|
|
}
|
2011-10-13 10:12:00 +00:00
|
|
|
},
|
|
|
|
pandora_showsidebar: function(data) {
|
|
|
|
data.value == that.options('elements')[0].collapsed && that.toggle(0);
|
2011-05-25 19:42:45 +00:00
|
|
|
}
|
2011-09-27 23:30:13 +00:00
|
|
|
});
|
2011-05-25 19:42:45 +00:00
|
|
|
return that;
|
|
|
|
};
|
|
|
|
|