diff --git a/static/js/pandora/findElement.js b/static/js/pandora/findElement.js index 1d25a37c..6fe5d0c7 100644 --- a/static/js/pandora/findElement.js +++ b/static/js/pandora/findElement.js @@ -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; } } }), diff --git a/static/js/pandora/menu.js b/static/js/pandora/menu.js index 0a02be28..ca0cea5a 100644 --- a/static/js/pandora/menu.js +++ b/static/js/pandora/menu.js @@ -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});