sync find select and find menu (fixes #591)

This commit is contained in:
rolux 2012-03-18 15:11:16 +00:00
parent 4ad4962d33
commit 364c9b004a
2 changed files with 9 additions and 3 deletions

View file

@ -4,7 +4,8 @@ pandora.ui.findElement = function() {
var findIndex = pandora.user.ui._findState.index,
findKey = pandora.user.ui._findState.key,
findValue = pandora.user.ui._findState.value,
hasPressedClear = false;
hasPressedClear = false,
previousFindKey = findKey;
var that = Ox.FormElementGroup({
elements: Ox.merge(pandora.user.ui._list ? [
pandora.$ui.findListSelect = Ox.Select({
@ -48,7 +49,7 @@ pandora.ui.findElement = function() {
change: function(data) {
if (data.value == 'advanced') {
that.update();
// fixme: uncheck menu item!
pandora.$ui.mainMenu.checkItem('findMenu_find_' + previousFindKey);
pandora.$ui.filterDialog = pandora.ui.filterDialog().open();
} else {
pandora.$ui.mainMenu.checkItem('findMenu_find_' + data.value);
@ -56,6 +57,7 @@ pandora.ui.findElement = function() {
autocomplete: autocompleteFunction(),
placeholder: ''
}).focusInput(true);
previousFindKey = data.value;
}
}
}),

View file

@ -175,9 +175,14 @@ pandora.ui.mainMenu = function() {
} else if (data.id == 'find') {
if (value) {
pandora.$ui.findSelect.value(value);
if (pandora.user.ui._findState.key == 'advanced') {
// fixme: autocomplete function doesn't get updated
pandora.$ui.findInput.options({placeholder: ''});
}
} else {
that.checkItem('findMenu_find_' + pandora.$ui.findSelect.value());
}
pandora.$ui.findInput.focusInput(true);
} else if (data.id == 'itemview') {
pandora.UI.set({itemView: value});
} else if (data.id == 'listview') {
@ -235,7 +240,6 @@ pandora.ui.mainMenu = function() {
) {
set.itemView = value;
}
Ox.print('SET', set)
pandora.UI.set(set);
} else if (data.id == 'viewicons') {
pandora.UI.set({icons: value});