Prevent submenu from getting destroyed bebore the container menu.
This commit is contained in:
parent
fc9135d335
commit
65c1ec4e94
1 changed files with 8 additions and 0 deletions
|
@ -10,6 +10,14 @@ Menu::popup = (window) ->
|
||||||
|
|
||||||
popup.call this, window
|
popup.call this, window
|
||||||
|
|
||||||
|
insertSubMenu = Menu::insertSubMenu
|
||||||
|
Menu::insertSubMenu = (index, command_id, label, submenu) ->
|
||||||
|
throw new TypeError('Invalid menu') unless submenu?.constructor is Menu
|
||||||
|
|
||||||
|
@menus = [] unless Array.isArray @menus
|
||||||
|
@menus.push submenu # prevent submenu from getting destroyed
|
||||||
|
insertSubMenu.apply this, arguments
|
||||||
|
|
||||||
Menu::appendItem = (args...) -> @insertItem -1, args...
|
Menu::appendItem = (args...) -> @insertItem -1, args...
|
||||||
Menu::appendCheckItem = (args...) -> @insertCheckItem -1, args...
|
Menu::appendCheckItem = (args...) -> @insertCheckItem -1, args...
|
||||||
Menu::appendRadioItem = (args...) -> @insertRadioItem -1, args...
|
Menu::appendRadioItem = (args...) -> @insertRadioItem -1, args...
|
||||||
|
|
Loading…
Reference in a new issue