mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-28 14:06:05 +10:00
Add shortcut to copy file content hash link ## What does this MR do? * Allows for multiple shortcut handlers to be initialised * Adds `y` shortcut to file pages to copy permalink URL. ## Are there points in the code the reviewer needs to double check? Ney. ## Why was this MR needed? UX ## What are the relevant issue numbers? Closes #14470. ## Screenshots (if relevant)  See merge request !4496
11 lines
295 B
CoffeeScript
11 lines
295 B
CoffeeScript
#= require shortcuts
|
|
|
|
class @ShortcutsBlob extends Shortcuts
|
|
constructor: (skipResetBindings) ->
|
|
super skipResetBindings
|
|
Mousetrap.bind('y', ShortcutsBlob.copyToClipboard)
|
|
|
|
@copyToClipboard: ->
|
|
clipboardButton = $('.btn-clipboard')
|
|
clipboardButton.click() if clipboardButton
|