fix the notes save button emphasized property

This commit is contained in:
Felipe Cecagno 2015-12-08 17:17:31 -02:00
parent 15ad366550
commit dd99398ff7

View File

@ -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);