From 19e45389e1228a881cdc4118687f74d7f50c3266 Mon Sep 17 00:00:00 2001 From: tilleul Date: Thu, 30 Nov 2017 14:38:03 +0100 Subject: [PATCH] Updated regex so custom width using calc() work (#1487) So far, for typedInput "" fields, only custom styles like "width:100%" or "width:75px" worked. Proposed change allows to use calc() as well like in "width:calc(100% - 120px)" --- editor/js/ui/common/typedInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/js/ui/common/typedInput.js b/editor/js/ui/common/typedInput.js index e481c6ef4..5803b290d 100644 --- a/editor/js/ui/common/typedInput.js +++ b/editor/js/ui/common/typedInput.js @@ -99,7 +99,7 @@ this.uiSelect = this.elementDiv.wrap( "
" ).parent(); var attrStyle = this.element.attr('style'); var m; - if ((m = /width\s*:\s*(\d+(%|px))/i.exec(attrStyle)) !== null) { + if ((m = /width\s*:\s*(calc\s*\(.*\)|\d+(%|px))/i.exec(attrStyle)) !== null) { this.element.css('width','100%'); this.uiSelect.width(m[1]); this.uiWidth = null;