1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Updated regex so custom width using calc() work (#1487)

So far, for typedInput "<input type=text>" 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)"
This commit is contained in:
tilleul 2017-11-30 14:38:03 +01:00 committed by Nick O'Leary
parent 6baedf909d
commit 19e45389e1

View File

@ -99,7 +99,7 @@
this.uiSelect = this.elementDiv.wrap( "<div>" ).parent(); this.uiSelect = this.elementDiv.wrap( "<div>" ).parent();
var attrStyle = this.element.attr('style'); var attrStyle = this.element.attr('style');
var m; 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.element.css('width','100%');
this.uiSelect.width(m[1]); this.uiSelect.width(m[1]);
this.uiWidth = null; this.uiWidth = null;