fixing more list selection bugs

This commit is contained in:
rolux 2011-09-17 13:04:10 +00:00
parent 823a14ebda
commit a8b0ae3da2
4 changed files with 25 additions and 10 deletions

View file

@ -9,13 +9,17 @@ pandora.URL = (function() {
if (/^\?url=/.test(search)) {
document.location = decodeURIComponent(search.substr(5));
} else {
pandora.Query.fromString(search);
pandora.UI.set({
section: 'items',
item: ''
});
if (!search && pandora.user.ui.showHome) {
pandora.$ui.home = pandora.ui.home().showScreen();
pandora.user.ui.list && pandora.Query.fromString(
'find=list:' + pandora.user.ui.list
);
} else {
pandora.Query.fromString(search);
pandora.UI.set({
section: 'items',
item: ''
});
}
}
},
@ -139,7 +143,6 @@ pandora.URL = (function() {
+ document.location.search
+ document.location.hash;
*/
pandora.Query.updateGroups();
Ox.forEach(regexps, function(fn, re) {
re = new RegExp(re);
if (re.test(pathname)) {
@ -148,6 +151,7 @@ pandora.URL = (function() {
return false;
}
});
pandora.Query.updateGroups();
pandora.user.ui.showHome = false;
},

View file

@ -181,10 +181,10 @@ pandora.ui.folderBrowserList = function(id) {
Ox.forEach(pandora.$ui.folderList, function($list, id_) {
id != id_ && $list.options('selected', []);
});
pandora.UI.set({list: data.ids[0]});
//pandora.UI.set({list: data.ids[0]});
pandora.URL.set('?find=list:' + data.ids[0]);
} else {
pandora.UI.set({list: ''});
//pandora.UI.set({list: ''});
pandora.URL.set('');
}
}

View file

@ -361,6 +361,7 @@ pandora.ui.folderList = function(id) {
Ox.forEach(pandora.$ui.folderList, function($list, id_) {
id != id_ && $list.options('selected', []);
});
//pandora.UI.set({list: data.ids[0]});
pandora.URL.set('?find=' + (id == 'volumes' ? 'volume' : 'list') + ':' + data.ids[0]);
} else {
//pandora.UI.set({list: ''});

View file

@ -2,6 +2,8 @@
pandora.ui.home = function() {
// fixme: if a list was selected previously, it will steal focus from the input element
var that = $('<div>')
.attr({id: 'home'})
.css({
@ -85,8 +87,11 @@ pandora.ui.home = function() {
})
.bindEvent({
submit: function(data) {
data.value && pandora.URL.set('/?find=' + data.value);
that.fadeOutScreen();
if (data.value) {
$findButton.triggerEvent('click');
} else {
$browseButton.triggerEvent('click');
}
}
})
.appendTo(that),
@ -105,6 +110,11 @@ pandora.ui.home = function() {
})
.bindEvent({
click: function() {
if (pandora.user.ui.list) {
Ox.forEach(pandora.$ui.folderList, function($list) {
$list.options({selected: []});
});
}
pandora.URL.set('/?find=' + $findInput.value());
that.fadeOutScreen();
}