skrollr-rails 0.6.15 → 0.6.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/skrollr-rails/version.rb +1 -1
- data/vendor/assets/javascripts/skrollr.js +8 -2
- data/vendor/assets/javascripts/skrollr.menu.js +14 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c81290ed073e2155007ec15149cf1bc759b6d53
|
4
|
+
data.tar.gz: 4ee1a773f944d7b1828037a3c5c80d82610f115a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbd79792287a6d4c5dbfa56eaa208ee026600ccfb431c76d8498b3f9e891f7400fdfd2acd1923853eaf8b07c823a5f79e0e4b9ebc4965edc34ce6632ee06b26c
|
7
|
+
data.tar.gz: 30b55e4dea3e1e43ab48a3aa3b39f84da1767aeb969f5b9351b9c85479eecd49f2add883130a8ccfb20c88c12c922796eb01f48bea9e8b3f3f8bf38fb5011f28
|
@@ -1303,8 +1303,14 @@
|
|
1303
1303
|
//Make sure z-index gets a <integer>.
|
1304
1304
|
//This is the only <integer> case we need to handle.
|
1305
1305
|
if(prop === 'zIndex') {
|
1306
|
-
|
1307
|
-
|
1306
|
+
if(isNaN(val)) {
|
1307
|
+
//If it's not a number, don't touch it.
|
1308
|
+
//It could for example be "auto" (#351).
|
1309
|
+
style[prop] = val;
|
1310
|
+
} else {
|
1311
|
+
//Floor the number.
|
1312
|
+
style[prop] = '' + (val | 0);
|
1313
|
+
}
|
1308
1314
|
}
|
1309
1315
|
//#64: "float" can't be set across browsers. Needs to use "cssFloat" for all except IE.
|
1310
1316
|
else if(prop === 'float') {
|
@@ -43,7 +43,7 @@
|
|
43
43
|
*/
|
44
44
|
var handleClick = function(e) {
|
45
45
|
//Only handle left click.
|
46
|
-
if(
|
46
|
+
if(e.which !== 1 && e.button !== 0) {
|
47
47
|
return;
|
48
48
|
}
|
49
49
|
|
@@ -116,6 +116,16 @@
|
|
116
116
|
return true;
|
117
117
|
};
|
118
118
|
|
119
|
+
var jumpStraightToHash = function() {
|
120
|
+
if(window.location.hash && document.querySelector) {
|
121
|
+
var link = document.querySelector('a[href="' + window.location.hash + '"]');
|
122
|
+
|
123
|
+
if(link) {
|
124
|
+
handleLink(link, true);
|
125
|
+
}
|
126
|
+
}
|
127
|
+
};
|
128
|
+
|
119
129
|
var defer = function(fn) {
|
120
130
|
window.setTimeout(fn, 1);
|
121
131
|
};
|
@@ -145,7 +155,7 @@
|
|
145
155
|
skrollr.addEvent(document, 'click', handleClick);
|
146
156
|
|
147
157
|
if(supportsHistory) {
|
148
|
-
|
158
|
+
skrollr.addEvent(window, 'popstate', function(e) {
|
149
159
|
var state = e.state || {};
|
150
160
|
var top = state.top || 0;
|
151
161
|
|
@@ -154,6 +164,8 @@
|
|
154
164
|
});
|
155
165
|
}, false);
|
156
166
|
}
|
167
|
+
|
168
|
+
jumpStraightToHash();
|
157
169
|
};
|
158
170
|
|
159
171
|
//Private reference to the initialized skrollr.
|
@@ -168,14 +180,6 @@
|
|
168
180
|
defer(function() {
|
169
181
|
if(window.location.hash) {
|
170
182
|
window.scrollTo(0, 0);
|
171
|
-
|
172
|
-
if(document.querySelector) {
|
173
|
-
var link = document.querySelector('a[href="' + window.location.hash + '"]');
|
174
|
-
|
175
|
-
if(link) {
|
176
|
-
handleLink(link, true);
|
177
|
-
}
|
178
|
-
}
|
179
183
|
}
|
180
184
|
});
|
181
185
|
}(document, window));
|