Moving navigation check to controller

This commit is contained in:
Rob Harrington
2015-01-20 09:00:17 +11:00
parent 585c061fb0
commit a0990c107f
3 changed files with 5 additions and 14 deletions

View File

@@ -1,10 +0,0 @@
angular.module("admin.utils").directive "navCheckCallback", (NavigationCheck)->
restrict: 'A'
scope:
navCheckCallback: '&'
link: (scope,element,attributes) ->
# Provide a callback, otherwise this default will be used:
callback = scope.navCheckCallback()
callback ||= ->
"You will lose any unsaved work!"
NavigationCheck.register(callback)