|
12 | 12 | })(function($) { |
13 | 13 | var NProgress = {}; |
14 | 14 |
|
15 | | - NProgress.version = '0.1.0'; |
| 15 | + NProgress.version = '0.1.1'; |
16 | 16 |
|
17 | 17 | var Settings = NProgress.settings = { |
18 | 18 | minimum: 0.08, |
|
23 | 23 | trickleRate: 0.02, |
24 | 24 | trickleSpeed: 800, |
25 | 25 | showSpinner: true, |
26 | | - template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner"><div class="spinner-icon"></div></div>' |
| 26 | + template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>' |
27 | 27 | }; |
28 | 28 |
|
29 | 29 | /** |
|
66 | 66 |
|
67 | 67 | $progress.queue(function(next) { |
68 | 68 | // Set positionUsing if it hasn't already been set |
69 | | - if (Settings.positionUsing == '') Settings.positionUsing = NProgress.getPositioningCSS(); |
| 69 | + if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); |
70 | 70 |
|
71 | 71 | // Add transition |
72 | 72 | $bar.css(barPositionCSS(n, speed, ease)); |
|
178 | 178 | transform: 'translate3d('+perc+'%,0,0)' |
179 | 179 | }); |
180 | 180 |
|
181 | | - if(!Settings.showSpinner) $el.find('.spinner').hide(); |
| 181 | + if (!Settings.showSpinner) |
| 182 | + $el.find('[role="spinner"]').remove(); |
182 | 183 |
|
183 | 184 | $el.appendTo(document.body); |
184 | 185 |
|
|
205 | 206 | /** |
206 | 207 | * Determine which positioning CSS rule to use. |
207 | 208 | */ |
| 209 | + |
208 | 210 | NProgress.getPositioningCSS = function() { |
209 | 211 | // Sniff on document.body.style |
210 | 212 | var bodyStyle = document.body.style; |
|
225 | 227 | // Browsers without translate() support, e.g. IE7-8 |
226 | 228 | return 'margin'; |
227 | 229 | } |
228 | | - } |
| 230 | + }; |
229 | 231 |
|
230 | 232 | /** |
231 | 233 | * Helpers |
|
255 | 257 | function barPositionCSS(n, speed, ease) { |
256 | 258 | var barCSS; |
257 | 259 |
|
258 | | - if (Settings.positionUsing == 'translate3d') { |
| 260 | + if (Settings.positionUsing === 'translate3d') { |
259 | 261 | barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; |
260 | | - } else if (Settings.positionUsing == 'translate') { |
| 262 | + } else if (Settings.positionUsing === 'translate') { |
261 | 263 | barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; |
262 | 264 | } else { |
263 | 265 | barCSS = { 'margin-left': toBarPerc(n)+'%' }; |
|
270 | 272 |
|
271 | 273 | return NProgress; |
272 | 274 | }); |
273 | | - |
|
0 commit comments