mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Check if selector matches parents of test element
Previously a menu for a keybinding with a .workspace selector would not display the shortcut because the selector wasn't matching the test editor element directly. Now the parent elements of the test editor are checked as well. Closes #2089
This commit is contained in:
@@ -69,7 +69,12 @@ class MenuManager
|
||||
@testEditor.classList.add('editor')
|
||||
testWorkspace.appendChild(@testEditor)
|
||||
|
||||
@testEditor.webkitMatchesSelector(selector)
|
||||
element = @testEditor
|
||||
while element
|
||||
return true if element.webkitMatchesSelector(selector)
|
||||
element = element.parentElement
|
||||
|
||||
false
|
||||
|
||||
# Public: Refreshes the currently visible menu.
|
||||
update: ->
|
||||
|
||||
Reference in New Issue
Block a user