diff --git a/src/pfwbged/collection/pfwbcollection.js b/src/pfwbged/collection/pfwbcollection.js index 5ad3145..05b5b83 100644 --- a/src/pfwbged/collection/pfwbcollection.js +++ b/src/pfwbged/collection/pfwbcollection.js @@ -490,6 +490,7 @@ function select_metatype(elem) $('.subtype input').change(store_subtypes); $('input[name="text-criteria-title"]').on('keyup', function() { + store_history_parameter('title', $(this).val()); if ($('option[value="Title"]:selected').length == 0) { $('.addIndex option[value="Title"]').prop('selected', true); $('.addIndex').trigger('change'); @@ -499,6 +500,7 @@ function select_metatype(elem) }); $('input[name="text-criteria-fulltext"]').on('keyup', function() { + store_history_parameter('fulltext', $(this).val()); if ($('option[value="SearchableText"]:selected').length == 0) { $('.addIndex option[value="SearchableText"]').prop('selected', true); $('.addIndex').trigger('change'); @@ -581,6 +583,24 @@ function select_metatype(elem) }); metatype.prop('checked', true); metatype.trigger('change'); // refreshes metatype, then subtypes. + + var title = get_history_parameter('title', ''); + var fulltext = get_history_parameter('fulltext', ''); + if (title) { + $('.addIndex option[value="Title"]').prop('selected', true); + $('.addIndex').trigger('change'); + $('option[value="Title"]:selected').parents('select').next().next().val(title); + } + if (fulltext) { + $('.addIndex option[value="SearchableText"]').prop('selected', true); + $('.addIndex').trigger('change'); + $('option[value="SearchableText"]:selected').parents('select').next().next().val(fulltext); + } + if (title || fulltext) { + $.querywidget.updateSearch(); + $('fieldset.text-fieldset div.criteria-content').show(); + $('fieldset.text-fieldset legend').addClass('expanded'); + } } } };