diff --git a/static/js/pandora/filterForm.js b/static/js/pandora/filterForm.js index 1475aad94..208582d87 100644 --- a/static/js/pandora/filterForm.js +++ b/static/js/pandora/filterForm.js @@ -62,6 +62,7 @@ pandora.ui.filterForm = function(list) { } else { Ox.Log('FIND', 'change form', data.query, pandora.user.ui.find) pandora.UI.set({find: Ox.clone(data.query, true)}); + pandora.$ui.findElement.update(); } } }) diff --git a/static/js/pandora/findElement.js b/static/js/pandora/findElement.js index e27e9648f..d2cd550cc 100644 --- a/static/js/pandora/findElement.js +++ b/static/js/pandora/findElement.js @@ -48,13 +48,10 @@ pandora.ui.findElement = function() { change: function(data) { var key = data.selected[0].id; if (key == 'advanced') { - pandora.$ui.findInput.options({ - placeholder: 'Edit Query...', - value: '' - }); + that.update(); pandora.$ui.filterDialog = pandora.ui.filterDialog().open(); } else { - Ox.Log('FIND', pandora.$ui.findInput.value()) + Ox.Log('FIND', 'select change', pandora.$ui.findInput.value()) pandora.$ui.findInput.options({ autocomplete: autocompleteFunction(), placeholder: '' @@ -136,6 +133,15 @@ pandora.ui.findElement = function() { } } : null; } + that.update = function() { + var findState = pandora.user.ui._findState; + pandora.$ui.findSelect.value(findState.key); + pandora.$ui.findInput.options( + findState.key == 'advanced' + ? {placeholder: 'Edit Query...', value: ''} + : {placeholder: '', value: findState.value} + ); + }; return that; }; diff --git a/static/js/pandora/mainPanel.js b/static/js/pandora/mainPanel.js index ae4c4b3b5..cf4fe8a51 100644 --- a/static/js/pandora/mainPanel.js +++ b/static/js/pandora/mainPanel.js @@ -36,10 +36,10 @@ pandora.ui.mainPanel = function() { pandora.$ui.filters[i].options({selected: data.selected}); } if (!Ox.isEqual(data.find, previousUI._filterState[i].find)) { - Ox.print(i, 'NOT EQUAL', data.find, previousUI._filterState[i].find) + Ox.Log('FIND', 'NOT EQUAL', data.find, previousUI._filterState[i].find) pandora.$ui.filters[i].reloadList(); } else { - Ox.print(i, 'EQUAL', data.find, previousUI._filterState[i].find) + Ox.Log('FIND', 'EQUAL', data.find, previousUI._filterState[i].find) } }); } else { diff --git a/static/js/pandora/utils.js b/static/js/pandora/utils.js index afccc6b6a..c8e1efcbc 100644 --- a/static/js/pandora/utils.js +++ b/static/js/pandora/utils.js @@ -974,6 +974,16 @@ pandora.unloadWindow = function() { */ }; +pandora.updateFindElement = function() { + var findState = pandora.user.ui._findState; + pandora.$ui.findSelect.value(findState.key); + pandora.$ui.findInput.options( + findState.key == 'advanced' + ? {placeholder: 'Edit Query...', value: ''} + : {placeholder: '', value: findState.value} + ); +}; + (function() { // Note: getFindState has to run after getListState and getFilterState