overleaf/services/web/public/coffee/keys/HotkeysManager.coffee

31 lines
589 B
CoffeeScript
Raw Normal View History

2014-02-12 05:23:40 -05:00
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"
}]