]> _ Git - fluidbook-html5.git/commitdiff
wip #4286 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Feb 2021 18:08:20 +0000 (19:08 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Feb 2021 18:08:20 +0000 (19:08 +0100)
js/libs/fluidbook/cart/fluidbook.cart.grandvision.js

index a507f6a00133dbd74accbf2d89451cde88a8f883..deed9657956b9c069eea2aff3a2444b5d49b769b 100644 (file)
@@ -46,9 +46,9 @@ FluidbookCartGrandVision.prototype = {
 
         $(document).on('change', 'select[name="box"]', function () {
             var val = $(this).val();
-            var opt = $(this).find('option[value="' + val + '"]');
+            var opt = $(this).find('option:selected');
             var i = $(opt).data('index');
-            console.log(val, opt, i);
+
             $this.boxIndex = parseInt(i);
             $this.fluidbook.cache.set('boxindex', $this.boxIndex);
             $this.setBox();
@@ -140,7 +140,7 @@ FluidbookCartGrandVision.prototype = {
     },
 
     removeCurrentBox: function () {
-        this.boxes.splice(this.boxIndex);
+        this.boxes.splice(this.boxIndex,1);
 
         if (this.boxes.length === 0) {
             this.boxes = [{name: 'Box 1', refs: []}];