diff options
| author | Stephen Blott | 2016-03-04 10:26:56 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2016-03-04 10:26:56 +0000 | 
| commit | 0dc6ecae624d5067f0b00332c2f41c556fa8bd03 (patch) | |
| tree | 878cd20723935d9c948f54f6c50dcd1e09057838 /pages | |
| parent | 67807bf8a80433fdaa8524d12be31031121b8e7a (diff) | |
| parent | 58e332fe942d01c8f4633b3415c460f678b2c75b (diff) | |
| download | vimium-0dc6ecae624d5067f0b00332c2f41c556fa8bd03.tar.bz2 | |
Merge pull request #2031 from smblott-github/clickable-command-names
Make command names in the help diablog clickable.
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/help_dialog.coffee | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee index 1b9420c3..0da4977b 100644 --- a/pages/help_dialog.coffee +++ b/pages/help_dialog.coffee @@ -38,6 +38,16 @@ HelpDialog =      @showAdvancedCommands(@getShowAdvancedCommands()) +    # When command names are shown, clicking on them copies their text to the clipboard (and they can be +    # clicked with link hints). +    for element in @dialogElement.getElementsByClassName "commandName" +      do (element) -> +        element.setAttribute "role", "link" +        element.addEventListener "click", -> +          commandName = element.textContent.replace("(","").replace ")", "" +          chrome.runtime.sendMessage handler: "copyToClipboard", data: commandName +          HUD.showForDuration("Yanked #{commandName}.", 2000) +    hide: -> UIComponentServer.postMessage "hide"    toggle: (html) -> | 
