});
$(document).on('click', '[data-cart-ref]', function () {
- var qty = 1;
- if ($(this).data('cart-qty') !== null) {
- qty = parseInt($(this).attr('data-cart-qty'));
- }
+ try {
+ var qty = 1;
+ if ($(this).data('cart-qty') !== null) {
+ qty = parseInt($(this).attr('data-cart-qty'));
+ }
- var ref = $(this).data('cart-ref');
- console.log(ref);
- $this.fluidbook.stats.track(15, $this.fluidbook.currentPage, ref);
+ var ref = $(this).data('cart-ref');
- var tooltipStyle = '';
- try {
- tooltipStyle = $this.instance.getTooltipStyle();
- } catch (e) {
+ $this.fluidbook.stats.track(15, $this.fluidbook.currentPage, ref);
+
+ var tooltipStyle = '';
+ try {
+ tooltipStyle = $this.instance.getTooltipStyle();
+ } catch (e) {
+
+ }
+ var tooltip = $this.instance.addToCart(ref, qty);
+ if (tooltip === undefined || tooltip === null || !tooltip || tooltip === true || tooltip === false || tooltip === 'true' || tooltip === 'false') {
+ tooltip = $this.fluidbook.l10n.__("the item has been added to your cart");
+ }
+ $this.fluidbook.tooltip.displayTooltip(tooltip, tooltipStyle);
+ setTimeout(function () {
+ $this.fluidbook.tooltip.hideTooltip();
+ }, 2500);
+ }catch (e){
}
- var tooltip = $this.instance.addToCart(ref, qty);
- if (tooltip === undefined || tooltip === null || !tooltip || tooltip === true || tooltip === false || tooltip === 'true' || tooltip === 'false') {
- tooltip = $this.fluidbook.l10n.__("the item has been added to your cart");
- }
- $this.fluidbook.tooltip.displayTooltip(tooltip, tooltipStyle);
- setTimeout(function () {
- $this.fluidbook.tooltip.hideTooltip();
- }, 2500)
return false;
});
}
t.attr('data-style', style);
css.maxWidth = 250;
- if(css.backgroundColor) {
- t.get(0).style.setProperty('--background-color', css.backgroundColor);
- }else{
- css.backgroundColor='';
- t.get(0).style.setProperty('--background-color', null);
+ if (Modernizr.cssvars) {
+ if (css.backgroundColor) {
+ t.get(0).style.setProperty('--background-color', css.backgroundColor);
+ } else {
+ css.backgroundColor = '';
+ t.get(0).style.setProperty('--background-color', null);
+ }
}
- if(css.color){
+ if (css.color) {
- }else{
- css.color='';
+ } else {
+ css.color = '';
}
t.css(css).html(text).show();
Modernizr.addTest('mozrotation', function () {
return Modernizr.firefox || Modernizr.edge || Modernizr.msie;
+});
+
+Modernizr.addTest('cssvars', function () {
+ return (window.CSS && window.CSS.supports && window.CSS.supports('--fake-var', "0"));
});
\ No newline at end of file