@@ -125,6 +125,7 @@ define(['filterutils','jquery', 'tippy', 'base' ], function(filterutils, $, tip
125125 const updateCartCounts = async function ( ) {
126126 var buttonContents = '<button class="btn filter-type clear-cart" role="button" title="Empty your cart."><i class="fa fa-rotate-left"></i></button>' ;
127127 let cart_has_contents = Boolean ( Object . keys ( window . proj_in_cart ) . length > 0 ) ;
128+ let cart_controls = $ ( '.cart-activated-controls' ) ;
128129 if ( cart_has_contents ) {
129130 var nmprojs = 0 ;
130131 var nmcases = 0 ;
@@ -136,18 +137,23 @@ define(['filterutils','jquery', 'tippy', 'base' ], function(filterutils, $, tip
136137 nmstudies = nmstudies + window . proj_in_cart [ projid ] [ 'studies' ] ;
137138 nmseries = nmseries + window . proj_in_cart [ projid ] [ 'series' ] ;
138139 }
139-
140140 let content = buttonContents + '<span id ="#cart_stats">Cart contents: ' + nmseries . toString ( ) + ' series from ' + nmprojs . toString ( ) +
141141 ' collections / ' + nmcases . toString ( ) + ' cases / ' + nmstudies . toString ( ) + ' studies</span> <span class="cart_disk_size">(Calculating size...)</span>' ;
142142 localStorage . setItem ( 'manifestSeriesCount' , nmseries ) ;
143143
144144 $ ( '#cart_stats_holder' ) . html ( content ) ;
145145 $ ( '#cart_stats' ) . removeClass ( 'empty-cart' ) ;
146- $ ( '.cart-activated-controls' ) . removeAttr ( 'disabled' ) ;
146+ cart_controls . each ( function ( ) {
147+ $ ( this ) . removeAttr ( 'disabled' ) ;
148+ ! $ ( this ) . hasClass ( 'tip-titled' ) && $ ( this ) . attr ( "title" , $ ( this ) . attr ( "data-default-title" ) ) ;
149+ } ) ;
147150 } else {
148151 $ ( '#cart_stats_holder' ) . html ( '<span id="#cart_stats">Your cart is currently empty</span>' ) ;
149152 $ ( '#cart_stats' ) . addClass ( 'empty-cart' ) ;
150- $ ( '.cart-activated-controls' ) . attr ( 'disabled' , 'disabled' ) ;
153+ cart_controls . each ( function ( ) {
154+ $ ( this ) . attr ( 'disabled' , 'disabled' ) ;
155+ ! $ ( this ) . hasClass ( 'tip-titled' ) && $ ( this ) . attr ( "title" , "Add items to the cart to enable this feature." ) ;
156+ } ) ;
151157 }
152158 let cart_disk_size = 0 ;
153159 let cart_disk_display_size = "(Calculating...)" ;
0 commit comments