Bugzilla – Attachment 38480 Details for
Bug 11890
Control-Click/Command-Click to open a link in a new tab not consistently working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11890: Click events on titles does not work as expected
Bug-11890-Click-events-on-titles-does-not-work-as-.patch (text/plain), 2.38 KB, created by
Jonathan Druart
on 2015-04-24 10:19:16 UTC
(
hide
)
Description:
Bug 11890: Click events on titles does not work as expected
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-04-24 10:19:16 UTC
Size:
2.38 KB
patch
obsolete
>From b4af716bcbab820117cbf1c5e9e6c88c340a5e42 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 24 Apr 2015 12:12:57 +0200 >Subject: [PATCH] Bug 11890: Click events on titles does not work as expected > >The browse results feature (bug 10404) modified the click events on >titles on the search result page (intranet). > >It introduced bad behaviors: >1/ ctrl+click on a title does not open a new tab >2/ middle click on a title does open a new tab but the browser is not >displayed. > >Note that this patch is not perfect, it fixes the 2 bad behaviors but >the ctrl+click gives the focus to the new tab (could go against the >preferences of the users). > >Test plan: >1/ On the staff interface, launch a search (catalogue/search.pl?q=XXX) >2/ When middle-clicking on a title, a new tab should open. On this tab >the browse result feature should be displayed >3/ Same for cltr+click >--- > koha-tmpl/intranet-tmpl/js/browser.js | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js >index b0676a5..81033ea 100644 >--- a/koha-tmpl/intranet-tmpl/js/browser.js >+++ b/koha-tmpl/intranet-tmpl/js/browser.js >@@ -60,9 +60,19 @@ KOHA.browser = function (searchid, biblionumber) { > } > $.cookie(me.searchid, JSON.stringify(me.searchCookie), { path: '/' }); > $(document).ready(function () { >- $('#searchresults table tr a[href*="detail.pl"]').click(function (ev) { >- ev.preventDefault(); >- window.location = $(this).attr('href') + '&searchid=' + me.searchid; >+ //FIXME It's not a good idea to modify the click events >+ $('#searchresults table tr a[href*="detail.pl"]').on('mousedown', function (ev) { >+ if ( ev.which == 2 || ev.which == 1 && ev.ctrlKey ) { >+ // Middle click or ctrl + click >+ ev.preventDefault(); >+ var newwindow = window.open( $(this).attr('href') + '&searchid=' + me.searchid, '_blank' ) >+ newwindow.blur(); >+ window.focus(); >+ } else if ( ev.which == 1 ) { >+ // Left click >+ ev.preventDefault(); >+ window.location = $(this).attr('href') + '&searchid=' + me.searchid; >+ } > }); > }); > }; >-- >2.1.0
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 11890
:
38480
|
38502
|
38640
|
38782
|
38783