Bugzilla – Attachment 37282 Details for
Bug 5844
Unhighlight cuts off some strings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 5844: Avoid strings cut on unhighlighing
Signed-off-Bug-5844-Avoid-strings-cut-on-unhighlig.patch (text/plain), 2.01 KB, created by
Marc Véron
on 2015-03-26 15:27:12 UTC
(
hide
)
Description:
[Signed-off] Bug 5844: Avoid strings cut on unhighlighing
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-03-26 15:27:12 UTC
Size:
2.01 KB
patch
obsolete
>From f4fa840019022fb099490998380cf29cdb9d6e8b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 26 Mar 2015 10:23:26 +0100 >Subject: [PATCH] [Signed-off] Bug 5844: Avoid strings cut on unhighlighing >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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 Véron <veron@veron.ch> >--- > .../bootstrap/lib/jquery/plugins/jquery.highlight-3.js | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js b/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js >index 69bb52d..8eabca4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/lib/jquery/plugins/jquery.highlight-3.js >@@ -44,10 +44,6 @@ jQuery.fn.highlight = function(pat) { > > jQuery.fn.removeHighlight = function() { > return this.find("span.term").each(function() { >- this.parentNode.firstChild.nodeName; >- with (this.parentNode) { >- replaceChild(this.firstChild, this); >- normalize(); >- } >- }).end(); >+ $(this).contents().unwrap(); >+ }); > }; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 5844
:
37273
|
37282
|
37317