overleaf/services/web/public/coffee/app/directives/stopPropagation.coffee

19 lines
399 B
CoffeeScript
Raw Normal View History

define [
"base"
], (App) ->
App.directive "stopPropagation", ($http) ->
return {
restrict: "A",
link: (scope, element, attrs) ->
element.bind attrs.stopPropagation, (e) ->
e.stopPropagation()
}
2014-06-23 07:37:05 -04:00
App.directive "preventDefault", ($http) ->
return {
restrict: "A",
link: (scope, element, attrs) ->
element.bind attrs.preventDefault, (e) ->
e.preventDefault()
}