Bug 5844: Avoid strings cut on unhighlighing
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 26 Mar 2015 09:23:26 +0000 (10:23 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 31 Mar 2015 13:13:18 +0000 (10:13 -0300)
commit2e4b574074ad8f66908cd22b466ba7a991696686
treebfe0af2770a82925238a1501e2340613be928fc1
parent934de70eec747f901904721fc12024051cf52f4c
Bug 5844: Avoid strings cut on unhighlighing

If a user is searching for several words and that one is contained in
another ( "mag ma" ), some characters are cut (removed from the DOM!).

To reproduce:
1/ search for "mag ma m"
2/ The result page contains "Magazine"
3/ "Mag" is highlighted
4/ Click on the "Unhighlight" link
5/ The "Magazine" words become "azine", "Mag" has been cut.
There is no way to show these characters again.

Test plan:
1/ Confirm the bad behavior without this patch
2/ Apply this patch
3/ search for "mag ma m"
4/ The result page contains "Magazine"
5/ "Mag" is highlighted
6/ Click on the "Unhighlight" link
7/ strings are unhighlighted and still in the DOM :)

Note that the Highlight link won't work very well (only "a" will be
highlighted, but considered as minor since this did not work before the
patch neither).

Followed test plan. Strings are no longer cut when unhiglighted.
Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js