[ARVADOS] updated: 1.1.2-24-g7ed41dc
Git user
git at public.curoverse.com
Fri Jan 5 14:35:24 EST 2018
Summary of changes:
.../app/assets/javascripts/components/edit_tags.js | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
via 7ed41dc0191d366c914850a350c3b30f769365af (commit)
from 90dd1c90fb310834234163711019e2b932c6e396 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 7ed41dc0191d366c914850a350c3b30f769365af
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Fri Jan 5 16:34:35 2018 -0300
12479: Allow the user to edit the currently accepted value on a
selectize field.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/apps/workbench/app/assets/javascripts/components/edit_tags.js b/apps/workbench/app/assets/javascripts/components/edit_tags.js
index e4eb200..fa3f13e 100644
--- a/apps/workbench/app/assets/javascripts/components/edit_tags.js
+++ b/apps/workbench/app/assets/javascripts/components/edit_tags.js
@@ -27,6 +27,16 @@ window.SimpleInput = {
}
window.SelectOrAutocomplete = {
+ onFocus: function(vnode) {
+ // Allow the user to edit an already entered value by removing it
+ // and filling the input field with the same text
+ activeSelect = vnode.state.selectized[0].selectize
+ value = activeSelect.getValue()
+ if (value.length > 0) {
+ activeSelect.clear(silent = true)
+ activeSelect.setTextboxValue(value)
+ }
+ },
view: function(vnode) {
return m("input", {
style: {
@@ -37,7 +47,7 @@ window.SelectOrAutocomplete = {
}, vnode.attrs.value)
},
oncreate: function(vnode) {
- this.selectized = $(vnode.dom).selectize({
+ vnode.state.selectized = $(vnode.dom).selectize({
labelField: 'value',
valueField: 'value',
searchField: 'value',
@@ -59,10 +69,13 @@ window.SelectOrAutocomplete = {
if (val != '') {
vnode.attrs.value(val)
}
+ },
+ onFocus: function() {
+ vnode.state.onFocus(vnode)
}
})
if (vnode.attrs.setFocus) {
- this.selectized[0].selectize.focus()
+ vnode.state.selectized[0].selectize.focus()
}
}
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list