forked from 0x2620/pandora
fix a bug where selecting a clip (causing list selection), then navigating away from and back to that list, would not reset list selection
This commit is contained in:
parent
4245a776ed
commit
599262e309
3 changed files with 18 additions and 29 deletions
|
@ -62,7 +62,7 @@ pandora.UI = (function() {
|
|||
// switch from item view to list view
|
||||
args['item'] = '';
|
||||
}
|
||||
add['itemFind'] = pandora.site.user.ui.itemFind;
|
||||
add.itemFind = pandora.site.user.ui.itemFind;
|
||||
if (list != self.previousUI._list) {
|
||||
Ox.Log('', 'FIND HAS CHANGED LIST')
|
||||
// if find has changed list
|
||||
|
@ -82,10 +82,24 @@ pandora.UI = (function() {
|
|||
} else {
|
||||
list = self.previousUI._list;
|
||||
}
|
||||
|
||||
item = args['item'] || pandora.user.ui.item;
|
||||
// it is important to check for find first, so that
|
||||
// if find changes list, list is correct here
|
||||
item = args.item || pandora.user.ui.item;
|
||||
|
||||
if (args.listView) {
|
||||
Ox.print('XXX')
|
||||
if (pandora.isClipView(args.listView)) {
|
||||
Ox.print('YYY')
|
||||
// when switching to a clip view, clear list selection
|
||||
args.listSelection = [];
|
||||
} else if (['text', 'position'].indexOf(pandora.user.ui.listSort[0].key) > -1) {
|
||||
Ox.print('ZZZ')
|
||||
// when switchin to a non-clip view, with a sort key that
|
||||
// only exists in clip view, reset sort to default
|
||||
args.listSort = pandora.site.user.ui.listSort;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pandora.user.ui.lists[list]) {
|
||||
add['lists.' + that.encode(list)] = {};
|
||||
}
|
||||
|
|
|
@ -50,16 +50,6 @@ pandora.ui.info = function() {
|
|||
pandora.$ui.leftPanel.size(2, height);
|
||||
pandora.resizeFolders();
|
||||
!ui.showInfo && pandora.$ui.leftPanel.css({bottom: -height + 'px'});
|
||||
/*
|
||||
if (ui.showInfo) {
|
||||
pandora.$ui.leftPanel.size(2, height, function() {
|
||||
pandora.resizeFolders();
|
||||
});
|
||||
} else {
|
||||
pandora.$ui.leftPanel.css({bottom: -height + 'px'});
|
||||
pandora.resizeFolders();
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
function updateInfo() {
|
||||
|
|
|
@ -26,22 +26,7 @@ pandora.ui.viewSelect = function() {
|
|||
})
|
||||
.bindEvent({
|
||||
change: function(data) {
|
||||
var key = data.selected[0].id,
|
||||
set = {};
|
||||
set[viewKey] = key;
|
||||
// FIXME: this may not work on page load, and would then have to be part of UI.js
|
||||
if (!ui.item) {
|
||||
// when changing the list view ...
|
||||
if (pandora.isClipView(key)) {
|
||||
// ... to a clip view, set listSelection to empty
|
||||
set.listSelection = [];
|
||||
} else if (['text', 'position'].indexOf(ui.listSort[0].key) > -1) {
|
||||
// ... to a non-clip view, with a sort key that only exists
|
||||
// in clip views, reset listSort to the default listSort
|
||||
set.listSort = pandora.site.user.ui.listSort;
|
||||
}
|
||||
}
|
||||
pandora.UI.set(set);
|
||||
pandora.UI.set(viewKey, data.selected[0].id);
|
||||
},
|
||||
pandora_listview: function(data) {
|
||||
that.selectItem(data.value);
|
||||
|
|
Loading…
Reference in a new issue