Use containerMenu as a base for HintMenu instead of regular menu
Change-Id: Ic1ed2e216a9c61aabf1f1cac41972b1a4e96a91a
diff --git a/dev/js/src/container/containeritem.js b/dev/js/src/container/containeritem.js
index a9a209b..6d0ef59 100644
--- a/dev/js/src/container/containeritem.js
+++ b/dev/js/src/container/containeritem.js
@@ -31,9 +31,11 @@
/**
* Get/create the document element of the container item. Can be overwritten. Standard class: li
+ * If you wish to change the textNode please overwrite the content function instead.
*/
element : function () {
- // already defined
+ //Call Order: First this class is created and then upgraded To whatever object is passed to container
+ //Then container calls first element() and then container()
if (this._el !== undefined) return this._el;
// Create list item
@@ -47,7 +49,32 @@
},
/**
- * Expected to be overwritten
+ * Get/create a TextNode with text "content". If content is left blank it gets set to this.defaultTextValue,
+ * or the empty string if it does not exists
+ * @param {String} content String to which to set the text
+ * @returns textNode with content or undefined
+ */
+ content : function (content) {
+ var newText; //set textNode to this
+ if (arguments.length === 1) { //new value!
+ newText = content;
+ } else { //use default
+ if (this.defaultTextValue === undefined) { //default default is ""
+ this.defaultTextValue = "";
+ }
+ newText = this.defaultTextValue;
+ };
+ if (this._content === undefined) { //no Element until now
+ this._content = document.createTextNode(newText); //create one
+ this.element().appendChild(this._content);
+ } else { //just change it
+ this._content.nodeValue = newText; // use nodeValue instead of _innerHTML
+ };
+ return this._content;
+ },
+
+ /**
+ * Expected to be overwritten. Default returns true always.
* @returns whether the item is currently an option to be selected, or if it should just be skipped
*/
isSelectable : function () {