Skip to content

Commit

Permalink
Merge pull request #13 from plentymarkets/cms/release_version_1.0.15
Browse files Browse the repository at this point in the history
allow floats as quantity with comma
  • Loading branch information
Crunch09 authored Dec 14, 2016
2 parents a24188e + 7a072bd commit df17783
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 17 deletions.
12 changes: 0 additions & 12 deletions dist/plentymarketsCMStools-1.0.14.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/plentymarketsCMStools-1.0.14.min.js.map

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TemplateCache["waitscreen/waitscreen.html"] = "<div id=\"PlentyWaitScreen\" clas
(function( $ )
{
// will be overridden by grunt
var version = "1.0.14";
var version = "1.0.15";

/**
* Collection of uncompiled registered factories & services.
Expand Down Expand Up @@ -903,7 +903,7 @@ TemplateCache["waitscreen/waitscreen.html"] = "<div id=\"PlentyWaitScreen\" clas
var $elem = $( elem );
var $quantityInput = $elem;
var maxLength = parseInt( $quantityInput.attr( 'maxlength' ) ) || 5;
var value = parseInt( $quantityInput.val() );
var value = convertToFloat( $quantityInput.val() );

setItemQuantityToNewValue($elem, $quantityInput, maxLength, value);
}
Expand Down Expand Up @@ -956,6 +956,16 @@ TemplateCache["waitscreen/waitscreen.html"] = "<div id=\"PlentyWaitScreen\" clas
}
}


function convertToFloat(n) {
n = n.replace(',', '.');
if(!isNaN(parseFloat(n)) && isFinite(n))
{
return parseFloat(n);
}
return 1;
}

}, ['BasketService'] );
}( jQuery, PlentyFramework ));

Expand Down
12 changes: 12 additions & 0 deletions dist/plentymarketsCMStools-1.0.15.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/plentymarketsCMStools-1.0.15.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plentymarketsCMStools",
"license": "AGPL-3.0",
"version": "1.0.14",
"version": "1.0.15",
"repository": "https://github.com/plentymarkets/plenty-cms-library.git",
"devDependencies": {
"grunt": "^0.4.5",
Expand Down
12 changes: 11 additions & 1 deletion src/directives/Basket.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
var $elem = $( elem );
var $quantityInput = $elem;
var maxLength = parseInt( $quantityInput.attr( 'maxlength' ) ) || 5;
var value = parseInt( $quantityInput.val() );
var value = convertToFloat( $quantityInput.val() );

setItemQuantityToNewValue($elem, $quantityInput, maxLength, value);
}
Expand Down Expand Up @@ -125,5 +125,15 @@
}
}


function convertToFloat(n) {
n = n.replace(',', '.');
if(!isNaN(parseFloat(n)) && isFinite(n))
{
return parseFloat(n);
}
return 1;
}

}, ['BasketService'] );
}( jQuery, PlentyFramework ));

0 comments on commit df17783

Please sign in to comment.