mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add Native.resetMainMenu and call it in global afterEach
This method removes any AtomMenuItems that aren't marked as 'global'. It ignores menu items that aren't instances of our custom subclass. This is needed by specs to clear any menu items added during tests. It will also be needed when a window loses focus and we want to remove any non-global menus associated with the window.
This commit is contained in:
@@ -39,3 +39,7 @@ class Native
|
||||
pb = OSX.NSPasteboard.generalPasteboard
|
||||
pb.declareTypes_owner [OSX.NSStringPboardType], null
|
||||
pb.setString_forType text, OSX.NSStringPboardType
|
||||
|
||||
resetMainMenu: (menu) ->
|
||||
OSX.NSApp.resetMainMenu
|
||||
|
||||
|
||||
Reference in New Issue
Block a user