overleaf/services/web/frontend/js/features/hotkeys-modal/controllers/hotkeys-modal-controller.js
Alf Eaton 59f6f34083 Merge pull request #3710 from overleaf/ae-refactor-hotkeys-modal
Refactor "HotKeys" modal

GitOrigin-RevId: 1df86322bac229bb04092e872300e5f1ee4cbddc
2021-03-06 03:04:46 +00:00

26 lines
664 B
JavaScript

import App from '../../../base'
import { react2angular } from 'react2angular'
import HotkeysModal from '../components/hotkeys-modal'
App.component('hotkeysModal', react2angular(HotkeysModal, undefined))
export default App.controller('HotkeysModalController', function($scope) {
$scope.show = false
$scope.isMac = /Mac/i.test(navigator.platform)
$scope.handleHide = () => {
$scope.$applyAsync(() => {
$scope.show = false
})
}
$scope.openHotkeysModal = () => {
$scope.$applyAsync(() => {
$scope.trackChangesVisible =
$scope.project && $scope.project.features.trackChangesVisible
$scope.show = true
})
}
})