fix some bugs with find on home screen

This commit is contained in:
rolux 2011-10-08 11:24:09 +00:00
parent a4d0ae4067
commit 7ac199a879
4 changed files with 19 additions and 1 deletions

View File

@ -372,6 +372,7 @@ pandora.URL = (function() {
} else {
if (
!pandora.$ui.appPanel
|| (keys.length == 1 && keys[0] == 'span')
|| keys.every(function(key) {
return /^videoPoints/.test(key);
})

View File

@ -113,6 +113,14 @@ pandora.ui.findElement = function() {
.css({
float: 'right',
margin: '4px'
})
.bindEvent({
// find may be changed from the home screen
pandora_find: function(data) {
pandora.$ui.findInput.options({
value: data.value.conditions[0].value
});
}
});
function autocompleteFunction() {
return pandora.user.ui.find.conditions.length ? function(value, callback) {

View File

@ -107,7 +107,15 @@ pandora.ui.home = function() {
click: function() {
var folder = pandora.getListData().folder;
folder && pandora.$ui.folderList[folder].options({selected: []});
pandora.URL.push('/=' + $findInput.value());
//pandora.URL.push('/=' + $findInput.value());
pandora.UI.set('find', {
conditions: [{
key: '*',
value: $findInput.value(),
operator: '='
}],
operator: '&'
});
that.fadeOutScreen();
}
})

View File

@ -750,6 +750,7 @@ pandora.selectList = function() {
// has a findKey as key and "=" as operator (and all other conditions
// are either list or groups), or if all conditions in an | query have
// the same group id as key and "==" as operator
Ox.print('getFindState', find)
var conditions, indices, state = {index: -1, key: '*', value: ''};
if (find.operator == '&') {
// number of conditions that are not list or groups