if (this.fluidbook.settings.cartLinkAppearance === 'overlay') {
$('a[data-cart-ref]').each(function () {
- var small = false;
- var smallwidth = false;
- var smallheight = false;
- if ($(this).outerWidth() < 280) {
- smallwidth = small = true;
- $(this).addClass('small').addClass('smallwidth');
+ var size = 2;
+ var c=[];
+ if ($(this).outerWidth() < 200) {
+ size = Math.min(size, 0);
+ c.push('small-w');
+ } else if ($(this).outerWidth() < 280) {
+ size = Math.min(size, 1);
+ c.push('medium-w');
}
- if ($(this).outerHeight() < 130) {
- smallheight = small = true;
- $(this).addClass('small').addClass('smallheight');
+ if ($(this).outerHeight() < 100) {
+ size = Math.min(size, 0);
+ c.push('small-h');
+ } else if ($(this).outerHeight() < 130) {
+ size = Math.min(size, 1);
+ c.push('medium-h');
+ }
+
+ if($(this).outerHeight() < 300){
+ c.push('condensed-h');
}
var bw = 250;
var bh = 100;
- if (small) {
+ if (size === 0) {
+ bw = 130;
+ bh = 60;
+ $(this).addClass('small');
+ } else if (size === 1) {
bw = 170;
bh = 80;
+ $(this).addClass('medium');
}
+ $(this).addClass(c);
var paddingTop = 0.5 * ($(this).outerHeight() - bh);
var paddingLeft = 0.5 * ($(this).outerWidth() - bw);