diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml index d63a7c8d47..4d5216f51a 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/sharednotes/views/SharedNotesWindow.mxml @@ -222,15 +222,31 @@ var menu:Menu = WellPositionedMenu.createMenu(null, menuData, btnSave, true); - menu.addEventListener(MenuEvent.ITEM_CLICK, saveMenuClickHandler); + registerListenersOnSaveMenu(menu); menu.show(); - menu.setFocus(); + } + + private function registerListenersOnSaveMenu(menu:Menu):void { + menu.addEventListener(MenuEvent.ITEM_CLICK, saveMenuClickHandler); + menu.addEventListener(MenuEvent.MENU_HIDE, saveMenuHideHandler); + } + + private function unregisterListenersOnSaveMenu(menu:Menu):void { + menu.removeEventListener(MenuEvent.ITEM_CLICK, saveMenuClickHandler); + menu.removeEventListener(MenuEvent.MENU_HIDE, saveMenuHideHandler); } private function saveMenuClickHandler(e:MenuEvent):void { e.item.handler(); } + private function saveMenuHideHandler(e:MenuEvent):void { + var menu:Menu = e.currentTarget as Menu; + unregisterListenersOnSaveMenu(menu); + + btnSave.emphasized = false; + } + protected function btnNew_clickHandler(event:MouseEvent):void { var noteNameWindow:IFlexDisplayObject = PopUpManager.createPopUp(FlexGlobals.topLevelApplication as DisplayObject, SharedNotesNameWindow, true);