angular-table 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/angular-table.js +14 -9
- data/lib/angular-table/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29059fb4c1ab0f15e5184bd0fb56ea8b6980c8dc
|
4
|
+
data.tar.gz: f2a9eb4d42f5cf334b4cd0495698ac62c31ea0c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42104469a3dab66925ecd6d32d9841e3756f9abfb5b993b615fd8bf62194366525be90b0ac66fb8edf11aba25ec86690017ab6b987692adb066f1d7cda54b2d5
|
7
|
+
data.tar.gz: 806949061dbd0980f3a144564d86153e61fed8778de85162a452446356e613c4c5983c730fa0fb01eb65f0ba0d4f04549fd0c9ab20a2ebb3eafb3a31c4f6d09a
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// author: Samuel Mueller
|
2
|
-
// version: 0.0.
|
2
|
+
// version: 0.0.6
|
3
3
|
// license: MIT
|
4
4
|
// homepage: http://github.com/ssmm/angular-table
|
5
5
|
(function() {
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
angular.module("angular-table").directive("atTable", [
|
9
9
|
"metaCollector", "setupFactory", function(metaCollector, setupFactory) {
|
10
|
-
var constructHeader, validateInput;
|
10
|
+
var constructHeader, normalizeInput, validateInput;
|
11
11
|
|
12
12
|
constructHeader = function(customHeaderMarkup, bodyDefinitions) {
|
13
13
|
var icon, td, th, title, tr, _i, _len;
|
@@ -37,12 +37,19 @@
|
|
37
37
|
throw "Either a list or pagination must be specified.";
|
38
38
|
}
|
39
39
|
};
|
40
|
+
normalizeInput = function(attributes) {
|
41
|
+
if (attributes.atPagination) {
|
42
|
+
attributes.pagination = attributes.atPagination;
|
43
|
+
return attributes.atPagination = null;
|
44
|
+
}
|
45
|
+
};
|
40
46
|
return {
|
41
47
|
restrict: "AC",
|
42
48
|
scope: true,
|
43
49
|
compile: function(element, attributes, transclude) {
|
44
50
|
var bodyDefinition, customHeaderMarkup, setup, tbody, thead, tr;
|
45
51
|
|
52
|
+
normalizeInput(attributes);
|
46
53
|
validateInput(attributes);
|
47
54
|
thead = element.find("thead");
|
48
55
|
tbody = element.find("tbody");
|
@@ -286,13 +293,14 @@
|
|
286
293
|
this.link = function() {};
|
287
294
|
};
|
288
295
|
PaginationSetup = function(attributes) {
|
289
|
-
var repeatString, sortContext;
|
296
|
+
var paginationName, repeatString, sortContext;
|
290
297
|
|
291
298
|
sortContext = attributes.sortContext || "global";
|
299
|
+
paginationName = attributes.pagination;
|
292
300
|
if (sortContext === "global") {
|
293
|
-
repeatString = "item in " +
|
301
|
+
repeatString = "item in " + paginationName + ".list " + orderByExpression + " " + limitToExpression;
|
294
302
|
} else if (sortContext === "page") {
|
295
|
-
repeatString = "item in " +
|
303
|
+
repeatString = "item in " + paginationName + ".list " + limitToExpression + " " + orderByExpression + " ";
|
296
304
|
} else {
|
297
305
|
throw "Invalid sort-context: " + sortContext + ".";
|
298
306
|
}
|
@@ -308,14 +316,11 @@
|
|
308
316
|
tdString += "<td> </td>";
|
309
317
|
}
|
310
318
|
fillerTr = angular.element("<tr>" + tdString + "</tr>");
|
311
|
-
fillerTr.attr("ng-repeat", "item in " +
|
319
|
+
fillerTr.attr("ng-repeat", "item in " + paginationName + ".getFillerArray() ");
|
312
320
|
return tbody.append(fillerTr);
|
313
321
|
}
|
314
322
|
};
|
315
323
|
this.link = function($scope, $element, $attributes) {
|
316
|
-
var paginationName;
|
317
|
-
|
318
|
-
paginationName = attributes.pagination;
|
319
324
|
$scope.fromPage = function() {
|
320
325
|
if ($scope[paginationName]) {
|
321
326
|
return $scope[paginationName].fromPage();
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular-table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|