fix bugs where ui find and the filter query would be the same object, keeping changes from triggering

This commit is contained in:
rolux 2011-11-10 10:30:39 +00:00
parent b6de7b2e4d
commit d539f6aebf
4 changed files with 7 additions and 14 deletions

View file

@ -3,15 +3,6 @@
pandora.ui.filterDialog = function(list) {
var that = Ox.Dialog({
buttons: [
Ox.Button({
id: 'debug',
title: 'Debug',
})
.bindEvent({
click: function() {
alert(JSON.stringify(pandora.$ui.filterForm.options('query')));
}
}),
/*
Ox.Button({
id: 'cancel',

View file

@ -24,7 +24,7 @@ pandora.ui.filterForm = function(list) {
sort: pandora.user.ui.listSort,
view: pandora.user.ui.listView
},
query: list ? list.query : pandora.user.ui.find,
query: Ox.clone(list ? list.query : pandora.user.ui.find, true),
sortKeys: pandora.site.sortKeys,
viewKeys: pandora.site.listViews
})
@ -51,8 +51,8 @@ pandora.ui.filterForm = function(list) {
});
});
} else {
pandora.UI.set({find: data.query});
//pandora.URL.replace();
Ox.Log('FIND', 'change form', data.query, pandora.user.ui.find)
pandora.UI.set({find: Ox.clone(data.query, true)});
}
}
});

View file

@ -19,7 +19,7 @@ pandora.ui.findElement = function() {
var key = data.selected[0].id;
pandora.$ui.findInput.options({
autocomplete: autocompleteFunction()
}).focus();
}).focusInput();
}
}),
] : [], [
@ -56,10 +56,11 @@ pandora.ui.findElement = function() {
pandora.$ui.filterDialog = pandora.ui.filterDialog()
)).open();
} else {
Ox.Log('FIND', pandora.$ui.findInput.value())
pandora.$ui.findInput.options({
autocomplete: autocompleteFunction(),
placeholder: ''
}).focus();
}).focusInput();
}
}
}),

View file

@ -21,6 +21,7 @@ pandora.ui.mainPanel = function() {
.bindEvent({
pandora_find: function() {
var previousUI = pandora.UI.getPrevious();
Ox.Log('FIND', 'handled in mainPanel', previousUI.item, previousUI._list)
if (!previousUI.item && pandora.user.ui._list == previousUI._list) {
if (['map', 'calendar'].indexOf(pandora.user.ui.listView) > -1) {
pandora.$ui.contentPanel.replaceElement(1,