mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
50df230846
GitOrigin-RevId: 02f97af1b9704782eee77a0b7dfc477ada23e34d
19 lines
608 B
JavaScript
19 lines
608 B
JavaScript
// TODO: This file was created by bulk-decaffeinate.
|
|
// Fix any style issues and re-enable lint.
|
|
/*
|
|
* decaffeinate suggestions:
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
*/
|
|
import App from '../base'
|
|
|
|
export default App.directive(
|
|
'onEnter',
|
|
() => (scope, element, attrs) =>
|
|
element.bind('keydown keypress', function (event) {
|
|
if (event.which === 13) {
|
|
scope.$apply(() => scope.$eval(attrs.onEnter, { event }))
|
|
return event.preventDefault()
|
|
}
|
|
})
|
|
)
|