From d20f6703c6ffb52cf23a0dcbcaa0c95f37671d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kremser?= Date: Sun, 28 Feb 2016 15:55:45 -0800 Subject: [PATCH] Allow negative numbers to be passed to parseHeight function fix --- src/gridstack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gridstack.js b/src/gridstack.js index 55742ae..f537d10 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -99,7 +99,7 @@ var height = val; var heightUnit = 'px'; 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) { throw new Error('Invalid height'); }