});
return false;
});
+
+ this.fluidbook.keyboard.keyShortcut('ctrl+shift+a', function () {
+ $this.addAllReferencesToCart();
+ });
},
emptyCart: function () {
}
},
+ addAllReferencesToCart: function () {
+ let $this = this;
+ for (let i = 1; i <= this.fluidbook.settings.pages; i++) {
+ let l = this.fluidbook.settings.links[i].normal;
+ if (l === undefined) {
+ continue;
+ }
+ $(l.join('')).find('[data-cart-ref]').each(function () {
+ let r = $(this).data('cart-ref');
+ $this.addToCart(r, 1, true);
+ });
+ }
+ },
+
removeFromCartByRef: function (ref) {
var key = this.items.indexOf(ref);
if (key >= 0) {
$.each(this.exportData, function (k, v) {
GET[v.name] = v.value;
});
- if(GET.pa===undefined){
+ if (GET.pa === undefined) {
GET.pa = 0;
}
- if(GET.pvp===undefined){
+ if (GET.pvp === undefined) {
GET.pvp = 0;
}
this.fluidbook.displayLoader();
}
var size = 2;
- if ($(this).outerWidth() < 200) {
+ var r=0.5;
+ if ($(this).outerWidth() < 200*r) {
size = Math.min(size, 0);
c.push('small-w');
- } else if ($(this).outerWidth() < 280) {
+ } else if ($(this).outerWidth() < 280*r) {
size = Math.min(size, 1);
c.push('medium-w');
}
- if ($(this).outerHeight() < 100) {
+ if ($(this).outerHeight() < 100*r) {
size = Math.min(size, 0);
c.push('small-h');
- } else if ($(this).outerHeight() < 130) {
+ } else if ($(this).outerHeight() < 130*r) {
size = Math.min(size, 1);
c.push('medium-h');
}
- if ($(this).outerHeight() < 300) {
+ if ($(this).outerHeight() < 300*r) {
c.push('condensed-h');
}
- var bw = 250;
- var bh = 100;
+ var bw = 250*r;
+ var bh = 100*r;
if (size === 0) {
- bw = 130;
- bh = 60;
+ bw = 130*r;
+ bh = 60*r;
$(this).addClass('small');
} else if (size === 1) {
- bw = 170;
- bh = 80;
+ bw = 170*r;
+ bh = 80*r;
$(this).addClass('medium');
}
$(this).addClass(c);
a[data-cart-ref] {
&.overlay {
+ @r: 0.5;
+
white-space: nowrap;
overflow: hidden;
color: #fff;
&.condensed-h {
div {
&.infos {
- bottom: 15px;
- right: 15px;
+ bottom: unit(15*@r,px);
+ right: unit(15*@r,px);
}
}
}
&.medium {
div {
&.infos {
- bottom: 15px;
- right: 15px;
+ bottom: unit(15*@r,px);
+ right: unit(15*@r,px);
}
- @w: 80px;
+ @w: unit(80*@r,px);
&.add {
- margin-left: unit(10, px);
+ margin-left: unit(10*@r, px);
}
&.add, &.remove {
&.small {
div {
&.infos {
- width: 40px;
- height: 40px;
- bottom: 10px;
- right: 10px;
+ width: unit(40*@r,px);
+ height: unit(40*@r,px);
+ bottom: unit(10*@r, px);
+ right: unit(10*@r, px);
}
- @w: 60px;
+ @w: unit(60*@r, px);
&.add {
- margin-left: unit(10, px);
+ margin-left: unit(10*@r, px);
}
&.add, &.remove {
div {
&.infos {
- @w: 50px;
+ @w: unit(50*@r, px);
width: @w;
height: @w;
position: absolute;
- bottom: 50px;
- right: 50px;
+ bottom: @w;
+ right: @w;
pointer-events: none;
display: none;
}
- @w: 100px;
+ @w: unit(100*@r, px);
&.add {
margin-left: unit(@w*0.5, px);