Skip to content

Commit d55e492

Browse files
author
Per Ploug Krogslund
committed
Route change confirm notification dialog
1 parent deeaf72 commit d55e492

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//used for the media picker dialog
2+
angular.module("umbraco").controller("Umbraco.Notifications.ConfirmRouteChangeController",
3+
function ($scope, $location, $log, notificationsService) {
4+
5+
$scope.discard = function(not){
6+
not.args.listener();
7+
$location.path(not.args.path);
8+
notificationsService.remove(not);
9+
};
10+
11+
$scope.stay = function(not){
12+
notificationsService.remove(not);
13+
};
14+
15+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<div ng-controller="Umbraco.Notifications.ConfirmRouteChangeController">
2+
<h4>You have unsaved changes</h4>
3+
<p>Are you sure you want to navigate away from this page? - you have unsaved changes</p>
4+
5+
<button class="btn btn-warning" ng-click="discard(notification)">Discard changes</button>
6+
<button class="btn" ng-click="stay(notification)">Stay</button>
7+
</div>

0 commit comments

Comments
 (0)