Use containerMenu as a base for HintMenu instead of regular menu
Change-Id: Ic1ed2e216a9c61aabf1f1cac41972b1a4e96a91a
diff --git a/dev/demo/hintdemo.js b/dev/demo/hintdemo.js
index 413625c..4f2e12d 100644
--- a/dev/demo/hintdemo.js
+++ b/dev/demo/hintdemo.js
@@ -15,6 +15,14 @@
KorAP.Hint = hintClass.create();
+ var newItem = {
+ onclick : function (e) { console.log("CI click"); console.log(this.element()); console.log("'" + this._menu.prefix() + "'" + " <-- If this returns the empty string when\
+ it should not, we know that the click event listener in container.js gets called too early and overwrites the prefix before we can read it.");},
+ chop : function () { console.log("chop"); },
+ defaultTextValue : "Text Example"
+ };
+ KorAP.Hint.menu("-").container().addItem(newItem); //must be added to a specific context menu.
+
/**
* Add query panel
*/
@@ -69,10 +77,13 @@
}
}]
});
+
+ console.log(KorAP.Hint);
});
});
function demoAlert (pos, msg) {
if (KorAP.hint !== undefined)
KorAP.Hint.alert(pos, msg);
+ console.log(KorAP.Hint);
}