Browse Source

dialog close

tags/0.1.0
Robin Thoni 8 years ago
parent
commit
a1435e4d8d
1 changed files with 43 additions and 0 deletions
  1. 43
    0
      src/modals/dialogclose.js

+ 43
- 0
src/modals/dialogclose.js View File

@@ -0,0 +1,43 @@
1
+/**
2
+ * Created by robin on 11/2/15.
3
+ */
4
+
5
+angular.module('luticateUtils')
6
+    .directive('dialogClose', ['luticateDialogErrorHelper',
7
+        function (luticateDialogErrorHelper) {
8
+            return {
9
+                restrict: 'EA',
10
+                transclude: true,
11
+                templateUrl: '/luticateUtils/dialogclose.html',
12
+                link: function link($scope, element, attrs) {
13
+                    $scope.title = attrs.title;
14
+
15
+                    $scope.__close = function()
16
+                    {
17
+                        if ($scope.onClosed) {
18
+                            $scope.onClosed();
19
+                        }
20
+                        $scope.$close();
21
+                    };
22
+                }
23
+            };
24
+        }]);
25
+
26
+angular.module("luticateUtils").run(["$templateCache", function($templateCache)
27
+{
28
+    $templateCache.put("/luticateUtils/dialogclose.html", '<div class="popin modal-content" xmlns="http://www.w3.org/1999/html">' +
29
+        '<div class="modal-header">{{ title }}</div>' +
30
+        '<div class="modal-body" lu-busy="modal">' +
31
+        '    <div class="form-group">' +
32
+        '    <ng-transclude></ng-transclude>' +
33
+        '    </div>' +
34
+        '    <div class="clearfix"></div>' +
35
+            /*'    <span class="error" ng-show="submitted">' +
36
+             '    <p class="error">{{ errorString }}</p>' +
37
+             '</span>' +*/
38
+        '</div>' +
39
+        '<div class="modal-footer">' +
40
+        '    <button type="button" class="btn btn-default" ng-click="__close()">Close</button>' +
41
+        '    </div>' +
42
+        '    </div>')
43
+}]);

Loading…
Cancel
Save