From 8fb041941d1c1c335c740e6e8c74c53374fdf711 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Mon, 23 Jan 2012 13:09:47 -0500 Subject: [PATCH] subtleties, one in UI and one in DB - take the width attribute of style from the plain HTML input control and apply it to the autosuggest dijit - oils_tsearch2('keyword'), not 'default' Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/sql/Pg/030.schema.metabib.sql | 8 +++++++- Open-ILS/web/opac/skin/default/js/search_bar.js | 8 +------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql index 066e6874bf..96e3834468 100644 --- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql +++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql @@ -143,7 +143,7 @@ CREATE TABLE metabib.browse_entry ( CREATE INDEX metabib_browse_entry_index_vector_idx ON metabib.browse_entry USING GIST (index_vector); CREATE TRIGGER metabib_browse_entry_fti_trigger BEFORE INSERT OR UPDATE ON metabib.browse_entry - FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('default'); + FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('keyword'); CREATE TABLE metabib.browse_entry_def_map ( @@ -483,6 +483,12 @@ BEGIN END IF; IF ind_data.browse_field THEN + -- A caveat about this SELECT: this should take care of replacing + -- old mbe rows when data changes, but not if normalization (by + -- which I mean specifically the output of + -- evergreen.oils_tsearch2()) changes. It may or may not be + -- expensive to add a comparison of index_vector to index_vector + -- to the WHERE clause below. SELECT INTO mbe_row * FROM metabib.browse_entry WHERE value = ind_data.value; IF FOUND THEN mbe_id := mbe_row.id; diff --git a/Open-ILS/web/opac/skin/default/js/search_bar.js b/Open-ILS/web/opac/skin/default/js/search_bar.js index 9a86edede0..12f827dc24 100644 --- a/Open-ILS/web/opac/skin/default/js/search_bar.js +++ b/Open-ILS/web/opac/skin/default/js/search_bar.js @@ -48,12 +48,6 @@ function updateSearchTypeSelector(id) { } function autoSuggestInit() { - /* For the "style" argument to the constructor below, IE 8 hates it if - * we supply dojo.attr("search_box", "style") as the value, which worked - * nicely in Google Chrome and Firefox. Filtering the "font" key/value - * pair out of that object gets IE not to throw an error, but even then - * the result is oddly ugly borders. So for now we're sadly hardcoding - * style. */ var widg = new openils.widget.AutoSuggest( { "storeArgs": { @@ -68,7 +62,7 @@ function autoSuggestInit() { if (event.charOrCode == dojo.keys.ENTER) searchBarSubmit(); }, - "style": {"width": "260px"}, + "style": {"width": dojo.attr("search_box", "style").width}, "value": ((getTerm() != null) ? getTerm() : "") }, "search_box" ); -- 2.11.0