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:
Kevin Sawicki
2014-05-16 11:57:04 -07:00
parent fc2830bacb
commit 628ea72943

View File

@@ -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: ->