Improve tree menu to be opened bottom-aligned to the button

Change-Id: I430780b8e4be8999ce067fb5a4cbf3bd50695289
diff --git a/dev/js/src/match.js b/dev/js/src/match.js
index 18052ec..63fa55a 100644
--- a/dev/js/src/match.js
+++ b/dev/js/src/match.js
@@ -244,8 +244,8 @@
           tm.readItems(that.treeMenuList());
 
           // Reposition and show menu
-          tm.attachTo(this);
           tm.show();
+          tm.attachTo(this);
           tm.focus();
         }
       );
diff --git a/dev/js/src/match/treemenu.js b/dev/js/src/match/treemenu.js
index 6bcff44..6a39720 100644
--- a/dev/js/src/match/treemenu.js
+++ b/dev/js/src/match/treemenu.js
@@ -50,7 +50,7 @@
     attachTo : function (e) {
       var bounding = e.getBoundingClientRect();
       this._element.style.left = bounding.left + "px";
-      this._element.style.top = bounding.top + "px";
+      this._element.style.top = (bounding.top + bounding.height - this._element.clientHeight) + "px";
       this.slider().reInit();
     }
   };