Skip to content

Commit ba34cb0

Browse files
committed
chore(release): release
1 parent ead4e29 commit ba34cb0

File tree

6 files changed

+89
-1
lines changed

6 files changed

+89
-1
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"description": "Make your HTML tables look great on every device",
99
"main": [
1010
"release/angular-responsive-tables.js",
11-
"release/style.css"
11+
"release/angular-responsive-tables.css"
1212
],
1313
"keywords": [
1414
"angular",

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"scripts": {
77
"build": "./node_modules/.bin/uglifyjs src/directive.js src/module.js -b -e --preamble \"// https://github.com/awerlang/angular-responsive-tables\" -o release/angular-responsive-tables.js",
88
"release": "./node_modules/.bin/uglifyjs src/directive.js src/module.js -c -e --preamble \"// https://github.com/awerlang/angular-responsive-tables\" -o release/angular-responsive-tables.min.js",
9+
"css": "type src\\style.css > release\\angular-responsive-tables.css",
10+
"cssmin": "type src\\style.css | \"./node_modules/.bin/cleancss\" -o release\\angular-responsive-tables.min.css",
911
"test": "karma start"
1012
},
1113
"repository": {
@@ -28,6 +30,7 @@
2830
},
2931
"homepage": "https://github.com/awerlang/angular-responsive-tables",
3032
"devDependencies": {
33+
"clean-css": "^3.2.10",
3134
"conventional-changelog": "0.0.17",
3235
"jasmine-core": "^2.2.0",
3336
"karma": "^0.12.31",
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/* original: http://css-tricks.com/responsive-data-tables/ */
2+
3+
.responsive {
4+
width: 100%;
5+
border-collapse: collapse;
6+
}
7+
8+
@media only screen and (max-width: 800px) {
9+
10+
/* Force table to not be like tables anymore */
11+
/* table.responsive,*/
12+
.responsive thead,
13+
.responsive tbody,
14+
.responsive th,
15+
.responsive td,
16+
.responsive tr {
17+
display: block;
18+
}
19+
20+
/* Hide table headers (but not display: none;, for accessibility) */
21+
.responsive thead tr {
22+
position: absolute;
23+
top: -9999px;
24+
left: -9999px;
25+
}
26+
27+
.responsive tr {
28+
border: 1px solid #ccc;
29+
}
30+
31+
.responsive td, .table.responsive td {
32+
/* Behave like a "row" */
33+
border: none;
34+
border-bottom: 1px solid #eee;
35+
position: relative;
36+
padding-left: 50%;
37+
white-space: normal;
38+
text-align: left;
39+
}
40+
41+
.responsive td:before {
42+
/* Now like a table header */
43+
position: absolute;
44+
/* Top/left values mimic padding */
45+
top: 6px;
46+
left: 6px;
47+
width: 45%;
48+
padding-right: 10px;
49+
white-space: nowrap;
50+
text-align: left;
51+
font-weight: bold;
52+
/*
53+
Label the data
54+
*/
55+
content: attr(data-title);
56+
}
57+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// https://github.com/awerlang/angular-responsive-tables
2+
(function() {
3+
"use strict";
4+
function wtResponsiveTable() {
5+
return {
6+
restrict: "A",
7+
compile: function(element, attrs) {
8+
attrs.$addClass("responsive");
9+
var headers = element[0].querySelectorAll("thead th");
10+
var rows = element[0].querySelectorAll("tbody tr");
11+
if (headers.length && rows.length) {
12+
rows = rows[0];
13+
Array.prototype.forEach.call(rows.querySelectorAll("td"), function(value, index) {
14+
var title = headers.item(index).textContent;
15+
if (title && !value.getAttributeNode("data-title")) {
16+
value.setAttribute("data-title", title);
17+
}
18+
});
19+
}
20+
}
21+
};
22+
}
23+
"use strict";
24+
angular.module("wt.responsive", []).directive("wtResponsiveTable", [ wtResponsiveTable ]);
25+
})();

release/angular-responsive-tables.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/angular-responsive-tables.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)