overleaf/services/web/public/coffee/ide/hotkeys/controllers/HotkeysController.coffee

26 lines
700 B
CoffeeScript
Raw Normal View History

2014-07-22 09:38:32 -04:00
define [
"base"
"ace/ace"
], (App) ->
2016-07-05 10:16:55 -04:00
App.controller "HotkeysController", ($scope, $modal, event_tracking) ->
2014-07-22 09:38:32 -04:00
$scope.openHotkeysModal = ->
2016-08-10 12:29:43 -04:00
event_tracking.sendMB "ide-open-hotkeys-modal"
2016-07-05 10:16:55 -04:00
2014-07-22 09:38:32 -04:00
$modal.open {
templateUrl: "hotkeysModalTemplate"
controller: "HotkeysModalController"
2017-05-19 10:51:32 -04:00
size: "lg"
resolve:
trackChangesVisible: () -> $scope.project.features.trackChangesVisible
2014-07-22 09:38:32 -04:00
}
App.controller "HotkeysModalController", ($scope, $modalInstance, trackChangesVisible)->
$scope.trackChangesVisible = trackChangesVisible
2014-07-22 09:38:32 -04:00
if ace.require("ace/lib/useragent").isMac
$scope.ctrl = "Cmd"
else
$scope.ctrl = "Ctrl"
$scope.cancel = () ->
$modalInstance.dismiss()