- do not parseInt but parseFloat
This commit is contained in:
Stuardo -StR- Rodríguez 2016-02-18 11:33:49 -05:00
commit b979982cc5
4 changed files with 5 additions and 5 deletions

4
dist/gridstack.js vendored
View file

@ -1112,12 +1112,12 @@
var height = val;
var heightUnit = 'px';
if (height && _.isString(height)) {
var match = height.match(/^([0-9]+)(px|em|rem)?$/);
var match = height.match(/^([0-9]*\.[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);
if (!match) {
throw new Error('Invalid height');
}
heightUnit = match[2];
height = parseInt(match[1]);
height = parseFloat(match[1]);
}
return {height: height, unit: heightUnit};
}