Cleanup and simplify JS code
Change-Id: I393e22763c1a1d18878026bf459b747b150429fb
diff --git a/dev/js/src/vc/stringval.js b/dev/js/src/vc/stringval.js
index 1cebde4..bd3a65c 100644
--- a/dev/js/src/vc/stringval.js
+++ b/dev/js/src/vc/stringval.js
@@ -1,7 +1,7 @@
/**
* Add string values to the virtual collection
*/
-define({
+define(['util'], {
/**
* Create new string value helper.
@@ -118,16 +118,12 @@
cl.add('regex');
// Add input field
- this._input = e.appendChild(
- document.createElement('input')
- );
+ this._input = e.addE('input');
if (this.value() !== undefined)
this._input.value = this.value();
// Add regex button
- var re = e.appendChild(
- document.createElement('div')
- );
+ var re = e.addE('div');
re.addEventListener(
'click',
function (ev) {
@@ -136,7 +132,7 @@
}.bind(this),
true
);
- re.appendChild(document.createTextNode('RE'));
+ re.addT('RE');
// If the focus is not on the text field anymore,
// delegate focus to