Bugzilla – Attachment 15190 Details for
Bug 9419
The highlight feature can cause a browser freeze
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9419: The highlight feature can cause a browser freeze
Bug-9419-The-highlight-feature-can-cause-a-browser.patch (text/plain), 2.13 KB, created by
Kyle M Hall (khall)
on 2013-02-08 18:07:21 UTC
(
hide
)
Description:
Bug 9419: The highlight feature can cause a browser freeze
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-02-08 18:07:21 UTC
Size:
2.13 KB
patch
obsolete
>From 4f570a6d02a7adcf52cd07c7d11caa4eab63d641 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 17 Jan 2013 16:52:18 +0100 >Subject: [PATCH] Bug 9419: The highlight feature can cause a browser freeze > >Test plan: >- switch on the OpacHighlightedWords syspref >- search at the opac and intranet a string with a space (e.g. > au,wrdl:"Shakespeare, William" note the double space after the comma) >- without the patch your browser will be frozen during a few seconds, > after applying it, the highlight works better. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/modules/catalogue/results.tt | 4 +++- > .../opac-tmpl/prog/en/modules/opac-results.tt | 8 +++++--- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 4d89a53..56dcfd0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -115,7 +115,9 @@ $(".addtocart").show(); > function highlightOn() { > var x; > for (x in q_array) { >- toHighlight.highlight(q_array[x]); >+ if ( q_array[x].length > 0 ) { >+ toHighlight.highlight(q_array[x]); >+ } > } > $(".highlight_toggle").toggle(); > }[% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >index 30682c4..5de5389 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >@@ -95,9 +95,11 @@ function highlightOff() { > function highlightOn() { > var x; > for (x in q_array) { >- $(".title").highlight(q_array[x]); >- $(".author").highlight(q_array[x]); >- $(".results_summary").highlight(q_array[x]); >+ if ( q_array[x].length > 0 ) { >+ $(".title").highlight(q_array[x]); >+ $(".author").highlight(q_array[x]); >+ $(".results_summary").highlight(q_array[x]); >+ } > } > $(".highlight_toggle").toggle(); > } >-- >1.7.2.5
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 9419
:
14676
|
15190
|
16832