Skip to content

Commit 766a056

Browse files
committed
Don’t allow negative values for Size and Border width
1 parent dd51143 commit 766a056

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

public/js/lib/views/arrow_configuration_view.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,12 @@ if (!('CSSArrowPlease' in window)) window.CSSArrowPlease = {};
9797
var target = $(ev.currentTarget),
9898
val = parseInt(target.val()),
9999
increment = ev.keyCode == 38 ? 1 : -1,
100-
multiply = ev.shiftKey ? 10 : 1;
100+
multiply = ev.shiftKey ? 10 : 1
101+
newVal = val + increment * multiply;
101102

102-
target.val(val + increment * multiply);
103+
if (newVal < 0) newVal = 0;
104+
105+
target.val(newVal);
103106
this._updateModel(ev);
104107
}
105108

0 commit comments

Comments
 (0)