Cleanup and simplify JS code
Change-Id: I393e22763c1a1d18878026bf459b747b150429fb
diff --git a/dev/js/src/hint/lengthField.js b/dev/js/src/hint/lengthField.js
index 0662b89..541b917 100644
--- a/dev/js/src/hint/lengthField.js
+++ b/dev/js/src/hint/lengthField.js
@@ -1,4 +1,4 @@
-define(['menu/lengthField'], function (lengthFieldClass) {
+define(['menu/lengthField', 'util'], function (lengthFieldClass) {
return {
/**
@@ -6,19 +6,18 @@
*/
create : function () {
return Object.create(lengthFieldClass).
- upgradeTo(this)._init();
+ upgradeTo(this)._init();
},
/**
* Override the prefix action.
*/
add : function (param) {
- this._element.appendChild(document.createElement('span'))
- .appendChild(document.createTextNode(param[0] + '--'));
+ this._element.addE('span').addT(param[0] + '--');
- var desc = this._element.appendChild(document.createElement('span'));
+ var desc = this._element.addE('span');
desc.classList.add("desc");
- desc.appendChild(document.createTextNode(param[2] + '--'));
+ desc.addT(param[2] + '--');
this._element.appendChild(desc);
}
};