fixing a list selection bug

This commit is contained in:
rolux 2011-09-17 12:16:31 +00:00
parent b1aa2fe73d
commit 823a14ebda
3 changed files with 20 additions and 24 deletions

View file

@ -221,26 +221,20 @@ pandora.Query = (function() {
return {
fromString: function(str) {
var data
query = Ox.unserialize(str),
sort = []
if ('find' in query) {
var query = Ox.unserialize(str),
data = parseFind(query.find || '');
Ox.print(Ox.repeat('-', 120));
Ox.print('STATE', data);
Ox.print(Ox.repeat('-', 120));
!pandora.user.ui.lists[data.list] && pandora.UI.set(
['lists', data.list].join('|'), pandora.site.user.ui.lists['']
);
pandora.UI.set({list: data.list});
pandora.user.ui.find = data.find;
pandora.user.ui.groupsData = data.groups;
Ox.print("PUUGD", pandora.user.ui.groupsData);
pandora.user.ui.query = data.query;
}
Ox.print(Ox.repeat('-', 120));
Ox.print('STATE', data);
Ox.print(Ox.repeat('-', 120));
!pandora.user.ui.lists[data.list] && pandora.UI.set(
['lists', data.list].join('|'), pandora.site.user.ui.lists['']
);
pandora.UI.set({list: data.list});
pandora.user.ui.find = data.find;
pandora.user.ui.groupsData = data.groups;
pandora.user.ui.query = data.query;
if ('sort' in query) {
sort = query.sort.split(',');
pandora.UI.set(['lists', pandora.user.ui.list, 'sort'].join('|'), query.sort.split(',').map(function(v) {
pandora.UI.set('lists|' + pandora.user.ui.list + '|sort', query.sort.split(',').map(function(v) {
var hasOperator = '+-'.indexOf(v[0]) > -1,
key = hasOperator ? v.substr(1) : v,
operator = hasOperator ? v[0]/*.replace('+', '')*/ : pandora.getSortOperator(key);
@ -250,9 +244,11 @@ pandora.Query = (function() {
};
}));
}
/*
if ('view' in query) {
pandora.UI.set(['lists', pandora.user.ui.list, 'listView'].join('|'), query.view);
}
*/
},
/*

View file

@ -6,11 +6,7 @@ pandora.URL = (function() {
var previousURL = '',
regexps = {
'^$': function(pathname, search) {
if (!search) {
if (pandora.user.ui.showHome) {
pandora.$ui.home = pandora.ui.home().showScreen();
}
} else if (/^\?url=/.test(search)) {
if (/^\?url=/.test(search)) {
document.location = decodeURIComponent(search.substr(5));
} else {
pandora.Query.fromString(search);
@ -18,6 +14,9 @@ pandora.URL = (function() {
section: 'items',
item: ''
});
if (!search && pandora.user.ui.showHome) {
pandora.$ui.home = pandora.ui.home().showScreen();
}
}
},
'^home$': function(pathname, search) {

View file

@ -356,13 +356,14 @@ pandora.ui.folderList = function(id) {
pandora.$ui.list.triggerEvent('paste', data);
},
select: function(data) {
//pandora.user.ui.item && pandora.UI.set({item: ''});
if (data.ids.length) {
Ox.forEach(pandora.$ui.folderList, function($list, id_) {
id != id_ && $list.options('selected', []);
});
pandora.URL.set('?find=' + (id == 'volumes' ? 'volume' : 'list') + ':' + data.ids[0]);
} else {
pandora.UI.set({list: ''});
//pandora.UI.set({list: ''});
pandora.URL.set('');
}
},