diff --git a/lib/client/menu.js b/lib/client/menu.js index c123f129..1427c0ba 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -23,7 +23,6 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO; Util.loadOnLoad([ load, - //setUploadToItemNames, Menu.show ]); @@ -34,13 +33,15 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO; MenuContext.hide(); }; - this.show = function() { - var fm, options, menuData, - x = (position || Position).x, + this.show = function(x, y ) { + var fm, options, menuData; + + if (!x || !y) { + x = (position || Position).x; y = (position || Position).y; + } if (!Loading) { - Key.unsetBind(); MenuContext.show(x, y); } else { fm = DOM.getFM(); @@ -50,7 +51,7 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO; beforShow : Key.unsetBind }; menuData = getMenuData(); - MenuContext = MenuIO(fm, options, menuData); + MenuContext = new MenuIO(fm, options, menuData); MenuContext.show(x, y); Loading = false; @@ -173,17 +174,25 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO; } function listener(event) { - var F9 = Key.F9, + var current, x, y, position, + F9 = Key.F9, ESC = Key.ESC, key = event.keyCode, isBind = Key.isBind(); if (isBind && key === F9) { - MenuContext.show(Position); + current = Info.element; + position = current.getBoundingClientRect(); + + x = position.left + position.width / 3; + y = position.top; + + MenuContext.show(x, y); DOM.preventDefault(event); - } else if (key === ESC) + } else if (key === ESC) { MenuContext.hide(); + } } init();