View | Details | Raw Unified | Return to bug 21174
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 416-421 OPAC: Link Here
416
                  no: "Don't allow"
416
                  no: "Don't allow"
417
            - patrons to store items in a temporary "Cart" on the OPAC.
417
            - patrons to store items in a temporary "Cart" on the OPAC.
418
        -
418
        -
419
            - pref: EnableOneClickToOpenCartPopup
420
              choices:
421
                  yes: Enable
422
                  no: "Don't enable"
423
            - Enable to load the cart popup immediately upon clicking on the OPAC cart icon.
424
        -
419
            - pref: OpacTopissue
425
            - pref: OpacTopissue
420
              choices:
426
              choices:
421
                  yes: Allow
427
                  yes: Allow
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (-11 / +23 lines)
Lines 16-35 Link Here
16
                        </a>
16
                        </a>
17
                    </h1>
17
                    </h1>
18
                    [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
18
                    [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
19
                        <div id="cartDetails" class="cart-message">Your cart is empty.</div>
19
                        [% IF ( Koha.Preference('EnableOneClickToOpenCartPopup') == 1 ) %]
20
                            <div id="cartDetails" class="cart-message" data-value="1">Your cart is empty.</div>
21
                        [% ELSE %]
22
                            <div id="cartDetails" class="cart-message">Your cart is empty.</div>
23
                        [% END %]
20
                    [% END %]
24
                    [% END %]
21
                    <ul class="nav">
25
                    <ul class="nav">
22
                        [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
26
                        [% IF ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
23
                            <li class="dropdown">
27
                            [% IF ( Koha.Preference('EnableOneClickToOpenCartPopup') == 1 ) %]
24
                                <a href="#" title="Collect items you are interested in" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button">
28
                                <li>
25
                                    <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> <b class="caret"></b>
29
                                    <a href="#" title="Collect items you are interested in" id="cartmenulink" data-toggle="dropdown" role="button">
26
                                </a>
30
                                        <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <span id="basketcount"></span> <b class="caret"></b>
27
                                <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu">
31
                                    </a>
28
                                    <li role="presentation">
32
                                </li>
29
                                        <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is empty.</a>
33
                            [% ELSE %]
30
                                    </li>
34
                                 <li class="dropdown">
31
                                </ul>
35
                                    <a href="#" title="Collect items you are interested in" class="dropdown-toggle" id="cartmenulink" data-toggle="dropdown" role="button">
32
                            </li>
36
                                         <i id="carticon" class="icon-shopping-cart icon-white"></i> <span class="cartlabel">Cart</span> <sp    an id="basketcount"></span> <b class="caret"></b>
37
                                    </a>
38
                                    <ul aria-labelledby="cartmenulink" role="menu" class="dropdown-menu">
39
                                        <li role="presentation">
40
                                           <a href="#" id="cartmenuitem" class="cart-message" tabindex="-1" role="menuitem">Your cart is e    mpty.</a>
41
                                        </li>
42
                                    </ul>
43
                                 </li>
44
                            [% END %]
33
                        [% END %]
45
                        [% END %]
34
                        [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
46
                        [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) && ( Koha.Preference( 'opacbookbag' ) == 1 ) %]
35
                            <li class="divider-vertical"></li>
47
                            <li class="divider-vertical"></li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-1 lines)
Lines 177-183 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
177
    });
177
    });
178
    //]]>
178
    //]]>
179
</script>
179
</script>
180
181
[% IF Koha.Preference( 'opacbookbag' ) == 1 %]
180
[% IF Koha.Preference( 'opacbookbag' ) == 1 %]
182
    [% Asset.js("js/basket.js") %]
181
    [% Asset.js("js/basket.js") %]
183
[% ELSIF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
182
[% ELSIF ( Koha.Preference( 'virtualshelves' ) == 1 ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js (-7 / +16 lines)
Lines 504-514 function updateAllLinks(target){ Link Here
504
}
504
}
505
505
506
$("#cartDetails").ready(function(){
506
$("#cartDetails").ready(function(){
507
    $("#cartDetails,#cartmenuitem,#cartmenulink").on("click",function(){ hideCart(); });
507
    var cartprefenabled = document.getElementById("cartDetails").getAttribute('data-value');
508
    $("#cartmenuitem").click(function(e){
508
    if (cartprefenabled == 1) {
509
        e.preventDefault();
509
        $("#cartDetails,#cartmenulink").on("click",function(){ hideCart(); });
510
        openBasket();
510
        $("#cartmenulink").click(function(e){
511
        $("li").closest().removeClass("open");
511
            e.preventDefault();
512
    });
512
            openBasket();
513
            $("li").closest().removeClass("open");
514
        });
515
    } else {
516
        $("#cartDetails,#cartmenuitem,#cartmenulink").on("click",function(){ hideCart(); });
517
        $("#cartmenuitem").click(function(e){
518
            e.preventDefault();
519
            openBasket();
520
            $("li").closest().removeClass("open");
521
        });
522
    }
513
    updateBasket(basketCount());
523
    updateBasket(basketCount());
514
});
524
});
515
- 

Return to bug 21174