|
@@ -4,8 +4,8 @@
|
4
|
4
|
|
5
|
5
|
|
6
|
6
|
angular.module('luticateUtils')
|
7
|
|
- .directive('dialogOkCancel', [
|
8
|
|
- function () {
|
|
7
|
+ .directive('dialogOkCancel', ['luticateDialogErrorHelper',
|
|
8
|
+ function (luticateDialogErrorHelper) {
|
9
|
9
|
return {
|
10
|
10
|
restrict: 'EA',
|
11
|
11
|
transclude: true,
|
|
@@ -15,12 +15,10 @@ angular.module('luticateUtils')
|
15
|
15
|
$scope.model = {};
|
16
|
16
|
$scope.pending = false;
|
17
|
17
|
$scope.submitted = false;
|
18
|
|
- $scope.errorString = "";
|
19
|
18
|
|
20
|
19
|
$scope.__submit = function()
|
21
|
20
|
{
|
22
|
21
|
$scope.submitted = true;
|
23
|
|
- $scope.errorString = "";
|
24
|
22
|
if ($scope.form.$valid) {
|
25
|
23
|
$scope.pending = true;
|
26
|
24
|
$scope.promise = $scope.submitForm();
|
|
@@ -38,12 +36,13 @@ angular.module('luticateUtils')
|
38
|
36
|
if ($scope.onError) {
|
39
|
37
|
$scope.onError(error);
|
40
|
38
|
}
|
41
|
|
- if (error.Data) {
|
42
|
|
- $scope.errorString = error.Data;
|
43
|
|
- }
|
44
|
|
- else {
|
45
|
|
- $scope.errorString = error;
|
46
|
|
- }
|
|
39
|
+ luticateDialogErrorHelper.errorDialog(error)
|
|
40
|
+ .result.then(function(data)
|
|
41
|
+ {
|
|
42
|
+ }, function(error2)
|
|
43
|
+ {
|
|
44
|
+ $scope.$dismiss(error);
|
|
45
|
+ });
|
47
|
46
|
$scope.pending = false;
|
48
|
47
|
});
|
49
|
48
|
}
|
|
@@ -76,9 +75,9 @@ angular.module("luticateUtils").run(["$templateCache", function($templateCache)
|
76
|
75
|
' <ng-transclude></ng-transclude>' +
|
77
|
76
|
' </div>' +
|
78
|
77
|
' <div class="clearfix"></div>' +
|
79
|
|
-' <span class="error" ng-show="submitted">' +
|
|
78
|
+/*' <span class="error" ng-show="submitted">' +
|
80
|
79
|
' <p class="error">{{ errorString }}</p>' +
|
81
|
|
-'</span>' +
|
|
80
|
+'</span>' +*/
|
82
|
81
|
'</div>' +
|
83
|
82
|
'<div class="modal-footer">' +
|
84
|
83
|
' <button type="button" class="btn btn-default" ng-click="__cancel()">Cancel</button>' +
|