projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c126c73
)
luci-base: cbi.js: recognize invalid input in dropdown create field
author
Jo-Philipp Wich
<jo@mein.io>
Wed, 10 Oct 2018 06:28:15 +0000
(08:28 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Wed, 10 Oct 2018 06:29:02 +0000
(08:29 +0200)
This is required to allow for validating the create field values in
later commits.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js
patch
|
blob
|
history
diff --git
a/modules/luci-base/htdocs/luci-static/resources/cbi.js
b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index fcfc5069426685da91362906040a31533765f8e7..e5acdbcd79d101ea8f18782731d39612ab213127 100644
(file)
--- a/
modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/
modules/luci-base/htdocs/luci-static/resources/cbi.js
@@
-2062,8
+2062,12
@@
function cbi_dropdown_init(sb) {
create.addEventListener('keydown', function(ev) {
switch (ev.keyCode) {
case 13:
- sbox.createItems(sb, this.value);
ev.preventDefault();
+
+ if (this.classList.contains('cbi-input-invalid'))
+ return;
+
+ sbox.createItems(sb, this.value);
this.value = '';
this.blur();
break;