Bugzilla – Attachment 77550 Details for
Bug 21174
Change default behavior to open OPAC cart in one click
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21174 - Implemented syspref to enable the loading of cart popup on one click
Bug-21174---Implemented-syspref-to-enable-the-load.patch (text/plain), 6.80 KB, created by
Alex Buckley
on 2018-08-08 05:18:39 UTC
(
hide
)
Description:
Bug 21174 - Implemented syspref to enable the loading of cart popup on one click
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2018-08-08 05:18:39 UTC
Size:
6.80 KB
patch
obsolete
>From 92ac946f0f67e6f9504ee8b5175ea545acd05b5a Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Wed, 8 Aug 2018 17:15:02 +1200 >Subject: [PATCH] Bug 21174 - Implemented syspref to enable the loading of cart > popup on one click > >Sponsored-By: Toi Ohomai Insitute of Technology, New Zealand >--- > .../prog/en/modules/admin/preferences/opac.pref | 6 ++++ > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 34 +++++++++++++++------- > .../bootstrap/en/includes/opac-bottom.inc | 1 - > koha-tmpl/opac-tmpl/bootstrap/js/basket.js | 22 ++++++++++---- > 4 files changed, 45 insertions(+), 18 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index f46dda3..74f83b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -416,6 +416,12 @@ OPAC: > no: "Don't allow" > - patrons to store items in a temporary "Cart" on the OPAC. > - >+ - pref: EnableOneClickToOpenCartPopup >+ choices: >+ yes: Enable >+ no: "Don't enable" >+ - Enable to load the cart popup immediately upon clicking on the OPAC cart icon. >+ - > - pref: OpacTopissue > choices: > yes: Allow >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 71151ec..3e7c43f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -16,20 +16,32 @@ > </a> > </h1> > [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %] >- <div id="cartDetails" class="cart-message">Your cart is empty.</div> >+ [% IF ( Koha.Preference('EnableOneClickToOpenCartPopup') == 1 ) %] >+ <div id="cartDetails" class="cart-message" data-value="1">Your cart is empty.</div> >+ [% ELSE %] >+ <div id="cartDetails" class="cart-message">Your cart is empty.</div> >+ [% END %] > [% END %] > <ul class="nav"> > [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %] >- <li class="dropdown"> >- <a href="#" title="Collect items you are interested in" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button"> >- <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> <b class="caret"></b> >- </a> >- <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu"> >- <li role="presentation"> >- <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is empty.</a> >- </li> >- </ul> >- </li> >+ [% IF ( Koha.Preference('EnableOneClickToOpenCartPopup') == 1 ) %] >+ <li> >+ <a href="#" title="Collect items you are interested in" id="cartmenulink" data-toggle="dropdown" role="button"> >+ <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> <b class="caret"></b> >+ </a> >+ </li> >+ [% ELSE %] >+ <li class="dropdown"> >+ <a href="#" title="Collect items you are interested in" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button"> >+ <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <sp an id="basketcount"></span> <b class="caret"></b> >+ </a> >+ <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu"> >+ <li role="presentation"> >+ <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is e mpty.</a> >+ </li> >+ </ul> >+ </li> >+ [% END %] > [% END %] > [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %] > <li class="divider-vertical"></li> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 999598f..00aa92f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -177,7 +177,6 @@ $.widget.bridge('uitooltip', $.ui.tooltip); > }); > //]]> > </script> >- > [% IF Koha.Preference( 'opacbookbag' ) == 1 %] > [% Asset.js("js/basket.js") %] > [% ELSIF ( Koha.Preference( 'virtualshelves' ) == 1 ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js >index 9eb6630..58afb4e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js >@@ -504,11 +504,21 @@ function updateAllLinks(target){ > } > > $("#cartDetails").ready(function(){ >- $("#cartDetails,#cartmenuitem,#cartmenulink").on("click",function(){ hideCart(); }); >- $("#cartmenuitem").click(function(e){ >- e.preventDefault(); >- openBasket(); >- $("li").closest().removeClass("open"); >- }); >+ var cartprefenabled = document.getElementById("cartDetails").getAttribute('data-value'); >+ if (cartprefenabled == 1) { >+ $("#cartDetails,#cartmenulink").on("click",function(){ hideCart(); }); >+ $("#cartmenulink").click(function(e){ >+ e.preventDefault(); >+ openBasket(); >+ $("li").closest().removeClass("open"); >+ }); >+ } else { >+ $("#cartDetails,#cartmenuitem,#cartmenulink").on("click",function(){ hideCart(); }); >+ $("#cartmenuitem").click(function(e){ >+ e.preventDefault(); >+ openBasket(); >+ $("li").closest().removeClass("open"); >+ }); >+ } > updateBasket(basketCount()); > }); >-- >2.1.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 21174
:
77550
|
77642
|
77684
|
78006
|
78007
|
78008
|
78009
|
78010
|
79647
|
79714
|
79856
|
80293
|
80294
|
80295
|
80373
|
80374
|
80375