Introduce a general buttongroup menu

Change-Id: I2d84af1c9d43ce3e57b10321bd7d414a64cf68a8
diff --git a/dev/js/src/match.js b/dev/js/src/match.js
index 4e7bd1a..59d2e83 100644
--- a/dev/js/src/match.js
+++ b/dev/js/src/match.js
@@ -11,10 +11,11 @@
  */
 define([
   'match/info',      // rename to anno
-  'match/treemenu',
+  'match/treeitem',
   'buttongroup',
+  'buttongroup/menu',
 	'util'
-], function (infoClass,matchTreeMenuClass,buttonGroupClass) { //, refClass) {
+], function (infoClass,treeItemClass,buttonGroupClass,buttonGroupMenuClass) { //, refClass) {
 
   // Localization values
   const loc   = KorAP.Locale;
@@ -210,7 +211,7 @@
       btns.add(
         loc.ADDTREE, ['tree'], function (e) {
           if (KorAP.TreeMenu === undefined) {
-            KorAP.TreeMenu = matchTreeMenuClass.create([]);
+            KorAP.TreeMenu = buttonGroupMenuClass.create([], treeItemClass);
           };
 
           var tm = KorAP.TreeMenu;
@@ -221,7 +222,7 @@
 
           // Reposition and show menu
           tm.show();
-          tm.attachTo(this);
+          tm.button(this);
           tm.focus();
         }
       );