Use requirejs for clientside scripting
diff --git a/dev/js/src/match/treemenu.js b/dev/js/src/match/treemenu.js
new file mode 100644
index 0000000..23341a4
--- /dev/null
+++ b/dev/js/src/match/treemenu.js
@@ -0,0 +1,26 @@
+ /**
+ * Menu to choose from for tree views.
+ */
+define(['menu', 'match/treeitem'], function (menuClass, itemClass) {
+ "use strict";
+
+ return {
+ create : function (info, params) {
+ var obj = Object.create(menuClass)
+ .upgradeTo(this)
+ ._init(itemClass, undefined, params);
+ obj.limit(6);
+ obj._info = info;
+
+ // This is only domspecific
+ obj.element().addEventListener('blur', function (e) {
+ this.menu.hide();
+ });
+
+ return obj;
+ },
+ info :function () {
+ return this._info;
+ }
+ };
+});