Skip to content

Commit 3f92d9c

Browse files
committed
-> Tooltip updates
1 parent 85303a2 commit 3f92d9c

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

static/js/cartutils.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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...)";

static/js/explore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ require([
525525

526526
tippy.delegate('.cases-table', copy_tip);
527527

528-
tippy.delegate('.filter-display-panel', {
528+
tippy.delegate('#body', {
529529
content: 'Get the citation list for this cohort.',
530530
theme: 'dark',
531531
placement: 'left',

0 commit comments

Comments
 (0)