Allow negative numbers to be passed to parseHeight function fix
This commit is contained in:
parent
0816163693
commit
d20f6703c6
|
@ -99,7 +99,7 @@
|
||||||
var height = val;
|
var height = val;
|
||||||
var heightUnit = 'px';
|
var heightUnit = 'px';
|
||||||
if (height && _.isString(height)) {
|
if (height && _.isString(height)) {
|
||||||
var match = height.match(/^((-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+)?|-?[0-9]+)(px|em|rem|vh|vw)?$/);
|
var match = height.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
throw new Error('Invalid height');
|
throw new Error('Invalid height');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue