Sfoglia il codice sorgente

ui fixes

tags/0.1.3^0
Robin Thoni 9 anni fa
parent
commit
8ef396ba2a

+ 1
- 1
dist/luticate-utils.min.js
File diff soppresso perché troppo grande
Vedi File


+ 0
- 7
src/lubasictable.css Vedi File

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

+ 15
- 6
src/lubasictable.js Vedi File

@@ -14,6 +14,7 @@ angular.module('luticateUtils')
14 14
                 link: function ($scope, element, attrs) {
15 15
                     $scope.items = [];
16 16
                     $scope.pages = [];
17
+                    $scope.maxPage = 1;
17 18
 
18 19
                     $scope.tableOptions = $scope.options();
19 20
                     $scope.tableOptions.luBasicTableScope = $scope;
@@ -85,6 +86,9 @@ angular.module('luticateUtils')
85 86
                     }
86 87
 
87 88
                     $scope.loadPage = function (page) {
89
+                        if (page < 0 || page >= $scope.maxPage) {
90
+                            return;
91
+                        }
88 92
                         $scope.tableOptions.checkedItems = [];
89 93
                         var promiseLoadItems = {
90 94
                             id: "promiseLoadItems_" + $scope.$id,
@@ -96,9 +100,9 @@ angular.module('luticateUtils')
96 100
                                 $scope.tableOptions.page = page;
97 101
                                 $scope.items = items;
98 102
                                 $scope.pages = [];
103
+                                $scope.maxPage = Math.max(items.Count / $scope.tableOptions.perPage, 1);
99 104
                                 var start = Math.max(0, $scope.tableOptions.page - 5);
100
-                                var end = Math.min(start + 10, (items.Count / $scope.tableOptions.perPage)
101
-                                    + (items.Count % $scope.tableOptions.perPage == 0 ? -1 : 0));
105
+                                var end = Math.min(start + 10, $scope.maxPage);
102 106
                                 for (var i = start; i < end; ++i) {
103 107
                                     $scope.pages.push(i);
104 108
                                 }
@@ -193,9 +197,14 @@ angular.module('luticateUtils').run(['$templateCache', function($templateCache)
193 197
 '</tbody>' +
194 198
 '</table>' +
195 199
 
196
-'<div class="col-sm-12 text-center">' +
197
-'    <a class="{{ p == tableOptions.page ? \'lu-basic-table-pagination-current\' : \'lu-basic-table-pagination-not-current\'}}"' +
198
-        'href="" ng-repeat="p in pages" ng-click="loadPage(p)">{{ p + 1 }}&nbsp;</a>' +
199
-'</div>' +
200
+        '<div class="col-sm-12 text-center">' +
201
+'<div class="pagination"><ul>' +
202
+'    <li class="previous">' +
203
+'        <a href="" class="fui-arrow-left" ng-click="loadPage(tableOptions.page - 1)"></a></li>' +
204
+'    <li ng-repeat="p in pages" ng-class="{ \'active\' : p == tableOptions.page}">' +
205
+'        <a href="" ng-click="loadPage(p)">{{ p + 1 }}</a></li>' +
206
+'    <li class="next">' +
207
+'        <a href="" class="fui-arrow-right" ng-click="loadPage(tableOptions.page + 1)"></a></li>' +
208
+'</ul></div></div>' +
200 209
 '    </div>');
201 210
 }]);

+ 6
- 6
src/lupermissionsedit.js Vedi File

@@ -117,10 +117,10 @@ angular.module('luticateUtils').run(['$templateCache', function($templateCache)
117 117
     $templateCache.put('/luticate/lupermissionedit.html', '<div class="col-sm-12">' +
118 118
 '        <div class="form-group col-sm-12"  lu-busy="permissionList">' +
119 119
 '    <div class="col-sm-6" ng-repeat="permission in permissions" lu-busy="{group: \'permission_\' + permission.Name}">' +
120
-'    <label class="col-sm-6 control-label">{{ permission.Name }}</label>' +
120
+'    <label class="col-sm-6 control-label" title="{{ permission.Name }}">{{ permission.Name }}</label>' +
121 121
 '<div class="col-sm-6">' +
122 122
 '    <div class="btn-group">' +
123
-'    <button class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="" lu-enable-permission="{{ luModelOptions.permissions.edit }}">' +
123
+'    <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href="" lu-enable-permission="{{ luModelOptions.permissions.edit }}">' +
124 124
 '    {{ permission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span>' +
125 125
 '    </button>' +
126 126
 '    <ul class="dropdown-menu">' +
@@ -129,7 +129,7 @@ angular.module('luticateUtils').run(['$templateCache', function($templateCache)
129 129
 '</ul>' +
130 130
 '</div>' +
131 131
 '<div class="btn-group">' +
132
-'    <button type="button" class="btn btn-default" ng-click="delPermission(permission)" lu-show-permission="{{ luModelOptions.permissions.del }}">' +
132
+'    <button type="button" class="btn btn-danger" ng-click="delPermission(permission)" lu-show-permission="{{ luModelOptions.permissions.del }}">' +
133 133
 '    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>' +
134 134
 '    </button>' +
135 135
 '    </div>' +
@@ -139,7 +139,7 @@ angular.module('luticateUtils').run(['$templateCache', function($templateCache)
139 139
 '    <div class="clearfix"></div>' +
140 140
 '    <div class="col-sm-12" lu-busy="permission_add" lu-show-permission="{{ luModelOptions.permissions.add }}">' +
141 141
 '    <div class="btn-group">' +
142
-'    <button class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
142
+'    <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
143 143
 '    {{ tmpPermission.Name }} <span class="caret"></span>' +
144 144
 '    </button>' +
145 145
 '    <ul class="dropdown-menu">' +
@@ -149,7 +149,7 @@ angular.module('luticateUtils').run(['$templateCache', function($templateCache)
149 149
 '</ul>' +
150 150
 '</div>' +
151 151
 '<div class="btn-group">' +
152
-'    <button class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
152
+'    <button class="btn btn-primary dropdown-toggle btn-select" data-toggle="dropdown" href="">' +
153 153
 '    {{ tmpPermission.Value ? \'Allow\' : \'Disallow\' }} <span class="caret"></span>' +
154 154
 '    </button>' +
155 155
 '    <ul class="dropdown-menu">' +
@@ -157,7 +157,7 @@ angular.module('luticateUtils').run(['$templateCache', function($templateCache)
157 157
 '<li><a href="" ng-click="tmpPermission.Value = true">Allow</a></li>' +
158 158
 '</ul>' +
159 159
 '</div>' +
160
-'<button type="button" class="btn btn-default" ng-click="addPermission(tmpPermission)" ng-disabled="allPermissionsCleared.length == 0">' +
160
+'<button type="button" class="btn btn-primary" ng-click="addPermission(tmpPermission)" ng-disabled="allPermissionsCleared.length == 0">' +
161 161
 '    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Add' +
162 162
 '    </button>' +
163 163
 '    </div>' +

+ 1
- 1
src/modals/dialogclose.js Vedi File

@@ -37,7 +37,7 @@ angular.module("luticateUtils").run(["$templateCache", function($templateCache)
37 37
              '</span>' +*/
38 38
         '</div>' +
39 39
         '<div class="modal-footer">' +
40
-        '    <button type="button" class="btn btn-default" ng-click="__close()">Close</button>' +
40
+        '    <button type="button" class="btn btn-inverse" ng-click="__close()">Close</button>' +
41 41
         '    </div>' +
42 42
         '    </div>')
43 43
 }]);

+ 3
- 3
src/modals/dialogerrorhelper.js Vedi File

@@ -39,9 +39,9 @@ angular.module("luticateUtils").run(["$templateCache", function($templateCache)
39 39
         '        <div class="clearfix"></div>' +
40 40
         '        </div>' +
41 41
         '        <div class="modal-footer">' +
42
-        '        <button type="submit" class="btn btn-pink" ng-click="$close()" ng-show="!showLogin">Close</button>' +
43
-        '        <button type="submit" class="btn btn-default" ng-click="$close()" ng-show="showLogin">Cancel</button>' +
44
-        '        <button type="button" class="btn btn-pink" ng-click="reconnect()" ng-show="showLogin">Login</button>' +
42
+        '        <button type="submit" class="btn btn-inverse" ng-click="$close()" ng-show="!showLogin">Close</button>' +
43
+        '        <button type="submit" class="btn btn-inverse" ng-click="$close()" ng-show="showLogin">Cancel</button>' +
44
+        '        <button type="button" class="btn btn-primary" ng-click="reconnect()" ng-show="showLogin">Login</button>' +
45 45
         '        </div>' +
46 46
         '        </div>')
47 47
 }]);

+ 1
- 1
src/modals/dialogokcancel.js Vedi File

@@ -80,7 +80,7 @@ angular.module("luticateUtils").run(["$templateCache", function($templateCache)
80 80
 '</span>' +*/
81 81
 '</div>' +
82 82
 '<div class="modal-footer">' +
83
-'    <button type="button" class="btn btn-default" ng-click="__cancel()">Cancel</button>' +
83
+'    <button type="button" class="btn btn-inverse" ng-click="__cancel()">Cancel</button>' +
84 84
 '    <button type="submit" class="btn btn-primary" ng-enabled="!pending">OK</button>' +
85 85
 '    </div>' +
86 86
 '    </form>' +

Loading…
Annulla
Salva