mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 15:30:50 -05:00
31 lines
589 B
CoffeeScript
31 lines
589 B
CoffeeScript
|
define [
|
||
|
"utils/Modal"
|
||
|
"ace/lib/useragent"
|
||
|
], (Modal) ->
|
||
|
useragent = require("ace/lib/useragent")
|
||
|
|
||
|
class HotKeysManager
|
||
|
template: $("#hotKeysLinkTemplate").html()
|
||
|
|
||
|
constructor: (@ide) ->
|
||
|
@$el = $(@template)
|
||
|
$("#toolbar-footer").append(@$el)
|
||
|
@$el.on "click", (e) =>
|
||
|
e.preventDefault()
|
||
|
@showHotKeys()
|
||
|
|
||
|
showHotKeys: () ->
|
||
|
el = $($("#hotKeysListTemplate").html())
|
||
|
if useragent.isMac
|
||
|
el.find(".win").hide()
|
||
|
else
|
||
|
el.find(".mac").hide()
|
||
|
|
||
|
new Modal
|
||
|
title: "Hot keys"
|
||
|
el: el
|
||
|
buttons: [{
|
||
|
text: "Hide"
|
||
|
class: "btn-primary"
|
||
|
}]
|