padma-assets 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0603753ba082c1eb25de9a7a1c6045c2918d98bf
|
4
|
+
data.tar.gz: 92a7129d42296ae6c67adf67ab040ef1ef085c6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2f608dd64c6a72c098fbdec5d7dc0868d0aeb1162dd091f0614b29f91e67ce8ecb3e5ad4204147de447e745ff75a707e99ab69bacfd7d580bb349dfa211eec7
|
7
|
+
data.tar.gz: 2e52a86a5aa41a03c2f9e3b4ea7577efb14c14260a197763e375fa37d0b070114e5641bc929cee3414ff3f6a25cd8ee8bd2146356cc9c594284aacf8b3d193ab
|
@@ -0,0 +1,149 @@
|
|
1
|
+
$(function(){
|
2
|
+
$('table').each(function() {
|
3
|
+
if($(this).find('thead').length > 0 && $(this).find('th').length > 0) {
|
4
|
+
// Clone <thead>
|
5
|
+
var $w = $(window),
|
6
|
+
$t = $(this),
|
7
|
+
$thead = $t.find('thead').clone(),
|
8
|
+
$col = $t.find('thead, tbody').clone();
|
9
|
+
|
10
|
+
// Add class, remove margins, reset width and wrap table
|
11
|
+
$t
|
12
|
+
.addClass('sticky-enabled')
|
13
|
+
.css({
|
14
|
+
margin: 0,
|
15
|
+
width: '100%'
|
16
|
+
}).wrap('<div class="sticky-wrap" />');
|
17
|
+
|
18
|
+
if($t.hasClass('overflow-y')) $t.removeClass('overflow-y').parent().addClass('overflow-y');
|
19
|
+
|
20
|
+
// Create new sticky table head (basic)
|
21
|
+
$t.after('<table class="sticky-thead" />');
|
22
|
+
|
23
|
+
// If <tbody> contains <th>, then we create sticky column and intersect (advanced)
|
24
|
+
if($t.find('tbody th').length > 0) {
|
25
|
+
$t.after('<table class="sticky-col" /><table class="sticky-intersect" />');
|
26
|
+
}
|
27
|
+
|
28
|
+
// Create shorthand for things
|
29
|
+
var $stickyHead = $(this).siblings('.sticky-thead'),
|
30
|
+
$stickyCol = $(this).siblings('.sticky-col'),
|
31
|
+
$stickyInsct = $(this).siblings('.sticky-intersect'),
|
32
|
+
$stickyWrap = $(this).parent('.sticky-wrap');
|
33
|
+
|
34
|
+
$stickyHead.append($thead);
|
35
|
+
|
36
|
+
$stickyCol
|
37
|
+
.append($col)
|
38
|
+
.find('thead th:gt(0)').remove()
|
39
|
+
.end()
|
40
|
+
.find('tbody td').remove();
|
41
|
+
|
42
|
+
$stickyInsct.html('<thead><tr><th>'+$t.find('thead th:first-child').html()+'</th></tr></thead>');
|
43
|
+
|
44
|
+
// Set widths
|
45
|
+
var setWidths = function () {
|
46
|
+
$t
|
47
|
+
.find('thead th').each(function (i) {
|
48
|
+
$stickyHead.find('th').eq(i).width($(this).width());
|
49
|
+
})
|
50
|
+
.end()
|
51
|
+
.find('tr').each(function (i) {
|
52
|
+
$stickyCol.find('tr').eq(i).height($(this).height());
|
53
|
+
});
|
54
|
+
|
55
|
+
// Set width of sticky table head
|
56
|
+
$stickyHead.width($t.width());
|
57
|
+
|
58
|
+
// Set width of sticky table col
|
59
|
+
$stickyCol.find('th').add($stickyInsct.find('th')).width($t.find('thead th').width())
|
60
|
+
},
|
61
|
+
repositionStickyHead = function () {
|
62
|
+
// Return value of calculated allowance
|
63
|
+
var allowance = calcAllowance();
|
64
|
+
|
65
|
+
// Check if wrapper parent is overflowing along the y-axis
|
66
|
+
if($t.height() > $stickyWrap.height()) {
|
67
|
+
// If it is overflowing (advanced layout)
|
68
|
+
// Position sticky header based on wrapper scrollTop()
|
69
|
+
if($stickyWrap.scrollTop() > 0) {
|
70
|
+
// When top of wrapping parent is out of view
|
71
|
+
$stickyHead.add($stickyInsct).css({
|
72
|
+
opacity: 1,
|
73
|
+
top: $stickyWrap.scrollTop()
|
74
|
+
});
|
75
|
+
} else {
|
76
|
+
// When top of wrapping parent is in view
|
77
|
+
$stickyHead.add($stickyInsct).css({
|
78
|
+
opacity: 0,
|
79
|
+
top: 0
|
80
|
+
});
|
81
|
+
}
|
82
|
+
} else {
|
83
|
+
// If it is not overflowing (basic layout)
|
84
|
+
// Position sticky header based on viewport scrollTop
|
85
|
+
if($w.scrollTop() > $t.offset().top && $w.scrollTop() < $t.offset().top + $t.outerHeight() - allowance) {
|
86
|
+
// When top of viewport is in the table itself
|
87
|
+
$stickyHead.add($stickyInsct).css({
|
88
|
+
opacity: 1,
|
89
|
+
top: $w.scrollTop() - $t.offset().top
|
90
|
+
});
|
91
|
+
} else {
|
92
|
+
// When top of viewport is above or below table
|
93
|
+
$stickyHead.add($stickyInsct).css({
|
94
|
+
opacity: 0,
|
95
|
+
top: 0
|
96
|
+
});
|
97
|
+
}
|
98
|
+
}
|
99
|
+
},
|
100
|
+
repositionStickyCol = function () {
|
101
|
+
if($stickyWrap.scrollLeft() > 0) {
|
102
|
+
// When left of wrapping parent is out of view
|
103
|
+
$stickyCol.add($stickyInsct).css({
|
104
|
+
opacity: 1,
|
105
|
+
left: $stickyWrap.scrollLeft()
|
106
|
+
});
|
107
|
+
} else {
|
108
|
+
// When left of wrapping parent is in view
|
109
|
+
$stickyCol
|
110
|
+
.css({ opacity: 0 })
|
111
|
+
.add($stickyInsct).css({ left: 0 });
|
112
|
+
}
|
113
|
+
},
|
114
|
+
calcAllowance = function () {
|
115
|
+
var a = 0;
|
116
|
+
// Calculate allowance
|
117
|
+
$t.find('tbody tr:lt(3)').each(function () {
|
118
|
+
a += $(this).height();
|
119
|
+
});
|
120
|
+
|
121
|
+
// Set fail safe limit (last three row might be too tall)
|
122
|
+
// Set arbitrary limit at 0.25 of viewport height, or you can use an arbitrary pixel value
|
123
|
+
if(a > $w.height()*0.25) {
|
124
|
+
a = $w.height()*0.25;
|
125
|
+
}
|
126
|
+
|
127
|
+
// Add the height of sticky header
|
128
|
+
a += $stickyHead.height();
|
129
|
+
return a;
|
130
|
+
};
|
131
|
+
|
132
|
+
setWidths();
|
133
|
+
|
134
|
+
$t.parent('.sticky-wrap').scroll($.throttle(250, function() {
|
135
|
+
repositionStickyHead();
|
136
|
+
repositionStickyCol();
|
137
|
+
}));
|
138
|
+
|
139
|
+
$w
|
140
|
+
.load(setWidths)
|
141
|
+
.resize($.debounce(250, function () {
|
142
|
+
setWidths();
|
143
|
+
repositionStickyHead();
|
144
|
+
repositionStickyCol();
|
145
|
+
}))
|
146
|
+
.scroll($.throttle(250, repositionStickyHead));
|
147
|
+
}
|
148
|
+
});
|
149
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
ul.nav.nav-tabs{ margin:20px 0 0;}
|
@@ -18,27 +18,26 @@ table.padma-table {
|
|
18
18
|
width:100%;
|
19
19
|
margin:0 auto 0;
|
20
20
|
th {
|
21
|
-
|
22
|
-
padding-top:14px;
|
23
|
-
padding-bottom:6px;
|
24
|
-
padding-left:10px;
|
25
|
-
background:#e8eaeb;
|
21
|
+
background:rgba(0, 0, 0, 0) -moz-linear-gradient(100% 100% 90deg, #f1f2f2, white) repeat scroll 0 0!important;
|
26
22
|
color: #4D4D4D;
|
27
23
|
font-family: Arial,Helvetica,sans-serif;
|
28
24
|
font-size: 12px;
|
29
25
|
font-weight: bold;
|
30
|
-
margin: 6px;
|
31
26
|
vertical-align: top;
|
32
27
|
border-right: 1px solid #CFCFCF;
|
33
28
|
border-bottom: 1px solid #CFCFCF;
|
34
29
|
text-align:left;
|
30
|
+
padding-top:10px;
|
31
|
+
padding-bottom:8px;
|
32
|
+
padding-left:10px;
|
33
|
+
padding-right:10px;
|
35
34
|
}
|
36
35
|
|
37
36
|
td {
|
38
|
-
height:10px;
|
39
37
|
padding-top:10px;
|
40
38
|
padding-bottom:8px;
|
41
|
-
|
39
|
+
padding-left:10px;
|
40
|
+
padding-right:10px;
|
42
41
|
border-top:0px solid #e0e0e0;
|
43
42
|
border-right:1px solid #CFCFCF;
|
44
43
|
color: #4D4D4D;
|
@@ -83,3 +82,74 @@ table.padma-table {
|
|
83
82
|
background-image: url('arrow_down.png');
|
84
83
|
}
|
85
84
|
}
|
85
|
+
|
86
|
+
.sticky-wrap {
|
87
|
+
overflow-x: auto;
|
88
|
+
overflow-y: hidden;
|
89
|
+
position: relative;
|
90
|
+
width: 100%;
|
91
|
+
}
|
92
|
+
.sticky-wrap .sticky-thead,
|
93
|
+
.sticky-wrap .sticky-col,
|
94
|
+
.sticky-wrap .sticky-intersect {
|
95
|
+
opacity: 0;
|
96
|
+
position: absolute;
|
97
|
+
top: 0;
|
98
|
+
left: 0;
|
99
|
+
transition: all .125s ease-in-out;
|
100
|
+
z-index: 50;
|
101
|
+
width: auto; /* Prevent table from stretching to full size */
|
102
|
+
}
|
103
|
+
.sticky-wrap .sticky-thead {
|
104
|
+
box-shadow: 0 0.25em 0.1em -0.1em rgba(0,0,0,.125);
|
105
|
+
z-index: 100;
|
106
|
+
width: 100%; /* Force stretch */
|
107
|
+
}
|
108
|
+
.sticky-wrap .sticky-intersect {
|
109
|
+
opacity: 1;
|
110
|
+
z-index: 150;
|
111
|
+
|
112
|
+
}
|
113
|
+
.sticky-wrap .sticky-intersect th {
|
114
|
+
background-color:#f2f2f2;
|
115
|
+
color: #4D4D4D;
|
116
|
+
}
|
117
|
+
.sticky-wrap td,
|
118
|
+
.sticky-wrap th {
|
119
|
+
box-sizing: border-box;
|
120
|
+
|
121
|
+
}
|
122
|
+
.sticky-thead thead td,
|
123
|
+
.sticky-thead thead th {
|
124
|
+
box-sizing: border-box;
|
125
|
+
background: #ffffff; /* Old browsers */
|
126
|
+
background: -moz-linear-gradient(top, #ffffff 0%, #f1f2f2 100%); /* FF3.6+ */
|
127
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#f1f2f2)); /* Chrome,Safari4+ */
|
128
|
+
background: -webkit-linear-gradient(top, #ffffff 0%,#f1f2f2 100%); /* Chrome10+,Safari5.1+ */
|
129
|
+
background: -o-linear-gradient(top, #ffffff 0%,#f1f2f2 100%); /* Opera 11.10+ */
|
130
|
+
background: -ms-linear-gradient(top, #ffffff 0%,#f1f2f2 100%); /* IE10+ */
|
131
|
+
background: linear-gradient(to bottom, #ffffff 0%,#f1f2f2 100%); /* W3C */
|
132
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f1f2f2',GradientType=0 ); /* IE6-9 */
|
133
|
+
color: #4D4D4D;
|
134
|
+
font-size:12px;
|
135
|
+
border-bottom:1px solid #cccccc;
|
136
|
+
border-top:1px solid #cccccc;
|
137
|
+
border-left:1px solid #cccccc;
|
138
|
+
padding:10px 8px 8px 8px;
|
139
|
+
line-height:14px;
|
140
|
+
font-family: Arial,Helvetica,sans-serif;
|
141
|
+
}
|
142
|
+
|
143
|
+
.sticky-thead thead th:first-child{ padding:0 12px 0 4px;}
|
144
|
+
|
145
|
+
|
146
|
+
/* Not needed for sticky header/column functionality */
|
147
|
+
td.user-name {
|
148
|
+
text-transform: capitalize;
|
149
|
+
}
|
150
|
+
.sticky-wrap.overflow-y {
|
151
|
+
overflow-y: auto;
|
152
|
+
max-height: 50vh;
|
153
|
+
}
|
154
|
+
|
155
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: padma-assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dwayne Macgowan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -60,8 +60,10 @@ files:
|
|
60
60
|
- app/assets/images/logo-padma-w.png
|
61
61
|
- app/assets/images/search.svg
|
62
62
|
- app/assets/javascripts/jquery.gritter.min.js
|
63
|
+
- app/assets/javascripts/jquery.stickyheader.js
|
63
64
|
- app/assets/javascripts/notifications.js.coffee
|
64
65
|
- app/assets/javascripts/padma-assets.js
|
66
|
+
- app/assets/stylesheets/accounts.css
|
65
67
|
- app/assets/stylesheets/bootstrap3-3-2.min.css
|
66
68
|
- app/assets/stylesheets/button.css.scss
|
67
69
|
- app/assets/stylesheets/colors.css.scss
|