Browse Source

ui fixes

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
12f571c0bb
6 changed files with 54 additions and 30 deletions
  1. 7
    0
      src/lubasictable.css
  2. 5
    8
      src/lubasictable.js
  3. 21
    21
      src/luedittable.js
  4. 1
    1
      src/lupermissionsedit.js
  5. 6
    0
      src/lupickertable.css
  6. 14
    0
      src/lupickertable.js

+ 7
- 0
src/lubasictable.css View File

1
+.lu-basic-table-pagination-current {
2
+    font-weight: bold;
3
+}
4
+
5
+.lu-basic-table-pagination-not-current {
6
+
7
+}

+ 5
- 8
src/lubasictable.js View File

22
                     }
22
                     }
23
                     if (typeof $scope.tableOptions.luBusy == 'string') {
23
                     if (typeof $scope.tableOptions.luBusy == 'string') {
24
                         $scope.tableOptions.luBusy = {
24
                         $scope.tableOptions.luBusy = {
25
-                            group: $scope.tableOptions.luBusy,
26
-                            templateLoader: "luticate-loader.html",
27
-                            templateError: "luticate-error.html"
25
+                            group: $scope.tableOptions.luBusy
28
                         };
26
                         };
29
                     }
27
                     }
30
                     if ($scope.tableOptions.luBusy == null) {
28
                     if ($scope.tableOptions.luBusy == null) {
31
                         $scope.tableOptions.luBusy = {
29
                         $scope.tableOptions.luBusy = {
32
-                            group:  'luBasicTableItemList_' + $scope.$id,
33
-                            templateLoader: "luticate-loader.html",
34
-                            templateError: "luticate-error.html"
30
+                            group:  'luBasicTableItemList_' + $scope.$id
35
                         };
31
                         };
36
                     }
32
                     }
37
                     if ($scope.tableOptions.page == null) {
33
                     if ($scope.tableOptions.page == null) {
82
                     $scope.loadPage = function (page) {
78
                     $scope.loadPage = function (page) {
83
                         $scope.tableOptions.checkedItems = [];
79
                         $scope.tableOptions.checkedItems = [];
84
                         var promiseLoadItems = {
80
                         var promiseLoadItems = {
85
-                            id: "promiseLoadItems",
81
+                            id: "promiseLoadItems_" + $scope.$id,
86
                             groups: [$scope.tableOptions.luBusy.group]
82
                             groups: [$scope.tableOptions.luBusy.group]
87
                         };
83
                         };
88
                         $scope.tableOptions.getLoadPagePromise(page, $scope.tableOptions.perPage, promiseLoadItems)
84
                         $scope.tableOptions.getLoadPagePromise(page, $scope.tableOptions.perPage, promiseLoadItems)
187
 '</table>' +
183
 '</table>' +
188
 
184
 
189
 '<div class="col-sm-12 text-center">' +
185
 '<div class="col-sm-12 text-center">' +
190
-'    <a class="{{ p == tableOptions.page ? \'pagination-current\' : \'pagination-not-current\'}}" href="" ng-repeat="p in pages" ng-click="loadPage(p)">{{ p + 1 }}&nbsp;</a>' +
186
+'    <a class="{{ p == tableOptions.page ? \'lu-basic-table-pagination-current\' : \'lu-basic-table-pagination-not-current\'}}"' +
187
+        'href="" ng-repeat="p in pages" ng-click="loadPage(p)">{{ p + 1 }}&nbsp;</a>' +
191
 '</div>' +
188
 '</div>' +
192
 '    </div>');
189
 '    </div>');
193
 }]);
190
 }]);

+ 21
- 21
src/luedittable.js View File

31
                         {
31
                         {
32
                         }
32
                         }
33
                     }
33
                     }
34
-                    var onItemClicked = $scope.tableOptions.onItemClicked;
35
-                    $scope.tableOptions.onItemClicked = function (item) {
36
-                        if (onItemClicked != null) {
37
-                            onItemClicked(item);
34
+                    if ($scope.tableOptions.onItemClicked == null) {
35
+                        $scope.tableOptions.onItemClicked = function (item) {
36
+                            var ctrl = $scope.tableOptions.getEditController();
37
+                            dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', item)
38
+                                .result.then(function (data) {
39
+                                    $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
40
+                                    $scope.tableOptions.onItemEdited(data);
41
+                                });
42
+                        };
43
+                    }
44
+                    if ($scope.tableOptions.addItem == null) {
45
+                        $scope.tableOptions.addItem = function()
46
+                        {
47
+                            var ctrl = $scope.tableOptions.getEditController();
48
+                            dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', $scope.tableOptions.editData)
49
+                                .result.then(function (data) {
50
+                                    $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
51
+                                    $scope.tableOptions.onItemAdded(data);
52
+                                });
38
                         }
53
                         }
39
-                        var ctrl = $scope.tableOptions.getEditController();
40
-                        dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', item)
41
-                            .result.then(function (data) {
42
-                                $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
43
-                                $scope.tableOptions.onItemEdited(data);
44
-                            });
45
-                    };
54
+                    }
46
 
55
 
47
 
56
 
48
                     if ($scope.tableOptions.canDel == null) {
57
                     if ($scope.tableOptions.canDel == null) {
113
                                     });
122
                                     });
114
                             });
123
                             });
115
                     };
124
                     };
116
-
117
-                    $scope.addItem = function () {
118
-                        var ctrl = $scope.tableOptions.getEditController();
119
-                        dialogs.create('views/modals/' + ctrl.toLowerCase() + '.html', ctrl + 'Controller', null)
120
-                            .result.then(function (data) {
121
-                                $scope.tableOptions.luBasicTableScope.loadPage($scope.tableOptions.page);
122
-                                $scope.tableOptions.onItemAdded(data);
123
-                            });
124
-                    };
125
                 }
125
                 }
126
             };
126
             };
127
         }
127
         }
136
 'ng-disabled="tableOptions.checkedItems.length == 0" ng-show="tableOptions.canDel()">' +
136
 'ng-disabled="tableOptions.checkedItems.length == 0" ng-show="tableOptions.canDel()">' +
137
 '    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete' +
137
 '    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete' +
138
 '    </button>' +
138
 '    </button>' +
139
-'    <button class="btn btn-default" type="button" ng-click="addItem()" ng-show="tableOptions.canAdd()">' +
139
+'    <button class="btn btn-default" type="button" ng-click="tableOptions.addItem()" ng-show="tableOptions.canAdd()">' +
140
 '    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add' +
140
 '    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add' +
141
 '    </button>' +
141
 '    </button>' +
142
 '    </div>');
142
 '    </div>');

+ 1
- 1
src/lupermissionsedit.js View File

93
 
93
 
94
                         var promiseLoadAllPermissions = {
94
                         var promiseLoadAllPermissions = {
95
                             id: "promiseLoadAllPermissions",
95
                             id: "promiseLoadAllPermissions",
96
-                            groups: ['permission_add']
96
+                            groups: ['permissionList']
97
                         };
97
                         };
98
                         luticateAuthPermissions.getAll(null, promiseLoadAllPermissions)
98
                         luticateAuthPermissions.getAll(null, promiseLoadAllPermissions)
99
                             .then(function (permissions) {
99
                             .then(function (permissions) {

+ 6
- 0
src/lupickertable.css View File

1
+.lu-picker-table-picked-items {
2
+    background-color: rgba(47, 47, 47, 0.2);
3
+    border: solid rgb(47, 47, 47) 1px;
4
+    margin: 2px 2px 2px 2px;
5
+    cursor: pointer;
6
+}

+ 14
- 0
src/lupickertable.js View File

76
                     {
76
                     {
77
                         return true;
77
                         return true;
78
                     };
78
                     };
79
+
80
+                    $scope.unPickItem = function(item)
81
+                    {
82
+                        var id = $scope.pickerOptions.getItemId(item);
83
+                        if ($scope.pickerOptions.checkedItems.find(function(it)
84
+                            {
85
+                                return it == id;
86
+                            }) != null) {
87
+                            $scope.pickerOptions.luBasicTableScope.toggleCheckedId(id, item);
88
+                        }
89
+                        else {
90
+                            $scope.pickerOptions.onItemChecked(item, false);
91
+                        }
92
+                    }
79
                 }
93
                 }
80
             };
94
             };
81
         }
95
         }

Loading…
Cancel
Save