forked from 0x2620/pandora
fix a bug where on the toolbar, sort select and order button would not be hidden or shown correctly
This commit is contained in:
parent
8c77c5c5b1
commit
234c5fc760
1 changed files with 6 additions and 3 deletions
|
@ -43,13 +43,16 @@ pandora.ui.toolbar = function() {
|
|||
that.bindEvent({
|
||||
pandora_listview: function(data) {
|
||||
var isNavigationView = ['map', 'calendar'].indexOf(data.value) > -1,
|
||||
wasNavigationView = ['map', 'calendar'].indexOf(data.previousValue) > -1;
|
||||
wasNavigationView = ['map', 'calendar'].indexOf(data.previousValue) > -1,
|
||||
action = isNavigationView ? 'hide' : 'show';
|
||||
Ox.print('IS/WAS', isNavigationView, wasNavigationView);
|
||||
if (isNavigationView != wasNavigationView) {
|
||||
pandora.$ui.sortSelect[isNavigationView ? 'hide' : 'show']();
|
||||
pandora.$ui.sortSelect[action]();
|
||||
pandora.$ui.orderButton[action]();
|
||||
}
|
||||
if (pandora.isClipView() != pandora.isClipView(data.previousValue)) {
|
||||
pandora.$ui.sortSelect.replaceWith(
|
||||
pandora.$ui.sortSelect = pandora.ui.sortSelect()
|
||||
pandora.$ui.sortSelect = pandora.ui.sortSelect()[action]()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue