From 628ea72943bbf9c5caf4434c142cb8394d4a6077 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 16 May 2014 11:57:04 -0700 Subject: [PATCH] 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 --- src/menu-manager.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/menu-manager.coffee b/src/menu-manager.coffee index cd24a3503..b7ed27ab3 100644 --- a/src/menu-manager.coffee +++ b/src/menu-manager.coffee @@ -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: ->