From dd99398ff78690b7107729c9b20d8f7e4751db78 Mon Sep 17 00:00:00 2001 From: Felipe Cecagno Date: Tue, 8 Dec 2015 17:17:31 -0200 Subject: [PATCH] fix the notes save button emphasized property --- .../sharednotes/views/SharedNotesWindow.mxml | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) 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);