tidy-table-rails 2.0.5 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4238f2a416eaf00ca21668c6a25cc9c9140b39c
4
- data.tar.gz: 48c6ae4a96d42d59b95f3a02fc6e971a28890ad2
3
+ metadata.gz: 0998be53e8b9554aa5697edb54326fc7cbe02d97
4
+ data.tar.gz: f5f23d132bdd4a90aed97bca9ecabba1d31f82b5
5
5
  SHA512:
6
- metadata.gz: dd4beecca4a8579493b522d34661d4b11107a85107ce95bbc663fd837e2df7b53ebbb36a9c775e4b13a9cfae07527e978478497dc59a50eeb5b2a8969def6325
7
- data.tar.gz: acf4f0332d518a2e16635ffb07d970460b36535069feb8d6678e5fd71d13132a37760e5ac7989c22c96d12859f673cb427fa541b9c234792a4eabcff9389d497
6
+ metadata.gz: 9a7001f75ad03469fc2b8cbbe9063362feb09849dd5ca8dfe0abd778fe84a46dfa1048a5538393447faf8bbbf83162c0e41c87b116bf18b0bea4310b7f31f6e5
7
+ data.tar.gz: 60d21d3d534e7e1d6c7e5e25445d601a152360ce005d1236916bba4b7325bd33bf649e3b50f5b7e48d1ad4a78f404e978bf8c0baa06fdb480a7d29c3cf15d402
@@ -1,7 +1,7 @@
1
1
  module Tidy
2
2
  module Table
3
3
  module Rails
4
- VERSION = "2.0.5"
4
+ VERSION = "2.1.0"
5
5
  end
6
6
  end
7
7
  end
@@ -37,7 +37,8 @@ if (!window.jQuery || (window.jQuery && parseInt(window.jQuery.fn.jquery.replace
37
37
  var defaults = {
38
38
  enableCheckbox: false,
39
39
  enableMenu: false,
40
- reverseSortDir: false
40
+ reverseSortDir: false,
41
+ responsive: false
41
42
  };
42
43
 
43
44
  if (arguments.length > 1) {
@@ -63,6 +64,11 @@ if (!window.jQuery || (window.jQuery && parseInt(window.jQuery.fn.jquery.replace
63
64
  });
64
65
  }
65
66
 
67
+ // responsive layout?
68
+ if (defaults.responsive) {
69
+ $this.addClass('tidy_table media');
70
+ }
71
+
66
72
  return $this.TidyTable('_createTable');
67
73
  },
68
74
 
@@ -92,18 +98,22 @@ if (!window.jQuery || (window.jQuery && parseInt(window.jQuery.fn.jquery.replace
92
98
  var table = $('<table></table>')
93
99
  .addClass('tidy_table');
94
100
 
101
+ // disable IE7/8 text selection
95
102
  table.mousedown(function() { return false; });
96
103
  table.mouseover(function() { return false; });
97
104
 
98
- var thead = $('<thead></thead>'),
99
- tbody = $('<tbody></tbody>');
105
+ var thead = $('<thead></thead>'),
106
+ tbody = $('<tbody></tbody>'),
107
+ titles = null;
100
108
 
101
109
  // .. <THEAD>
102
110
  (function() {
111
+ titles = data.config.columnTitles;
112
+
103
113
  var row = $('<tr></tr>');
104
114
 
105
- for (var i = 0; i < data.config.columnTitles.length; i++) {
106
- var title = data.config.columnTitles[i];
115
+ for (var i = 0; i < titles.length; i++) {
116
+ var title = titles[i];
107
117
 
108
118
  var col = $('<th></th>')
109
119
  .append(title)
@@ -49,6 +49,7 @@ table.tidy_table td {
49
49
 
50
50
  table.tidy_table td {
51
51
  border-right: 1px solid #EEEEEE;
52
+ border-top: 1px solid #CCCCCC;
52
53
  padding: 7px 20px 7px 20px;
53
54
  }
54
55
 
@@ -71,6 +72,68 @@ table.tidy_table td:nth-last-child(1) {
71
72
  border-right: none;
72
73
  }
73
74
 
74
- table.tidy_table td {
75
- border-top: 1px solid #CCCCCC;
75
+ table.tidy_table td span.label {
76
+ display: none;
77
+ }
78
+
79
+ /* responsive (mobile devices) */
80
+
81
+ @media only screen and (min-device-width: 0px) and (max-device-width: 768px) {
82
+ .tidy_table.media {
83
+ margin: 0px !important;
84
+ width: auto !important;
85
+ overflow: none;
86
+ }
87
+
88
+ .tidy_table.media select {
89
+ position: relative;
90
+ right: 30px;
91
+ }
92
+
93
+ .tidy_table.media table {
94
+ border: 0px;
95
+ border-top: 1px solid #DDDDDD;
96
+ width: 100%;
97
+ }
98
+
99
+ .tidy_table.media table tr {
100
+ border-bottom: 1px solid #CCCCCC;
101
+ position: relative;
102
+ }
103
+
104
+ .tidy_table.media table tbody tr:last-child {
105
+ border: none;
106
+ }
107
+
108
+ .tidy_table.media table th,
109
+ .tidy_table.media table td {
110
+ box-sizing: border-box;
111
+ border: 0px;
112
+ clear: both;
113
+ float: left;
114
+ padding-left: 10px;
115
+ }
116
+
117
+ .tidy_table.media table th:first-child,
118
+ .tidy_table.media table td:first-child {
119
+ background-color: transparent;
120
+ padding: 10px;
121
+ position: absolute;
122
+ right: 0px;
123
+ top: 2px;
124
+ width: auto;
125
+ }
126
+
127
+ .tidy_table.media table th {
128
+ text-align: left;
129
+ width: 100%;
130
+ }
131
+
132
+ .tidy_table.media table th:first-child {
133
+ top: -40px;
134
+ }
135
+
136
+ .tidy_table.media table td {
137
+ background-color: transparent;
138
+ }
76
139
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tidy-table-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dbackowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-09 00:00:00.000000000 Z
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails