forked from 0x2620/pandora
fix a bug with switching list view while viewing an item
This commit is contained in:
parent
5c983597c4
commit
4329922d6b
1 changed files with 16 additions and 15 deletions
|
@ -40,22 +40,23 @@ pandora.ui.toolbar = function() {
|
||||||
);
|
);
|
||||||
that.bindEvent({
|
that.bindEvent({
|
||||||
pandora_listview: function(data) {
|
pandora_listview: function(data) {
|
||||||
var isNavigationView = ['map', 'calendar'].indexOf(data.value) > -1,
|
var isNavigationView, wasNavigationView;
|
||||||
wasNavigationView = ['map', 'calendar'].indexOf(data.previousValue) > -1,
|
if (!pandora.user.ui.item) {
|
||||||
action = isNavigationView ? 'hide' : 'show';
|
isNavigationView = ['map', 'calendar'].indexOf(data.value) > -1;
|
||||||
Ox.Log('', 'IS/WAS', isNavigationView, wasNavigationView);
|
wasNavigationView = ['map', 'calendar'].indexOf(data.previousValue) > -1;
|
||||||
if (isNavigationView != wasNavigationView) {
|
if (isNavigationView != wasNavigationView) {
|
||||||
if (isNavigationView) {
|
if (isNavigationView) {
|
||||||
pandora.$ui.sortSelect.remove();
|
pandora.$ui.sortSelect.remove();
|
||||||
pandora.$ui.orderButton.remove();
|
pandora.$ui.orderButton.remove();
|
||||||
} else {
|
} else {
|
||||||
pandora.$ui.sortSelect = pandora.ui.sortSelect().insertAfter(pandora.$ui.viewSelect);
|
pandora.$ui.sortSelect = pandora.ui.sortSelect().insertAfter(pandora.$ui.viewSelect);
|
||||||
pandora.$ui.orderButton = pandora.ui.orderButton().insertAfter(pandora.$ui.sortSelect);
|
pandora.$ui.orderButton = pandora.ui.orderButton().insertAfter(pandora.$ui.sortSelect);
|
||||||
|
}
|
||||||
|
} else if ((data.value == 'clip') != (data.previousValue == 'clip')) {
|
||||||
|
pandora.$ui.sortSelect.replaceWith(
|
||||||
|
pandora.$ui.sortSelect = pandora.ui.sortSelect()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else if ((data.value == 'clip') != (data.previousValue == 'clip')) {
|
|
||||||
pandora.$ui.sortSelect.replaceWith(
|
|
||||||
pandora.$ui.sortSelect = pandora.ui.sortSelect()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue