|
83 | 83 |
|
84 | 84 | if (n === 1) {
|
85 | 85 | // Fade out
|
86 | | - css(progress, { |
87 | | - transition: 'none', |
88 | | - opacity: 1 |
| 86 | + css(progress, { |
| 87 | + transition: 'none', |
| 88 | + opacity: 1 |
89 | 89 | });
|
90 | 90 | progress.offsetWidth; /* Repaint */
|
91 | 91 |
|
92 | 92 | setTimeout(function() {
|
93 | | - css(progress, { |
94 | | - transition: 'all ' + speed + 'ms linear', |
95 | | - opacity: 0 |
| 93 | + css(progress, { |
| 94 | + transition: 'all ' + speed + 'ms linear', |
| 95 | + opacity: 0 |
96 | 96 | });
|
97 | 97 | setTimeout(function() {
|
98 | 98 | NProgress.remove();
|
|
220 | 220 | if (NProgress.isRendered()) return document.getElementById('nprogress');
|
221 | 221 |
|
222 | 222 | addClass(document.documentElement, 'nprogress-busy');
|
223 | | - |
| 223 | + |
224 | 224 | var progress = document.createElement('div');
|
225 | 225 | progress.id = 'nprogress';
|
226 | 226 | progress.innerHTML = Settings.template;
|
|
229 | 229 | perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0),
|
230 | 230 | parent = document.querySelector(Settings.parent),
|
231 | 231 | spinner;
|
232 | | - |
| 232 | + |
233 | 233 | css(bar, {
|
234 | 234 | transition: 'all 0 linear',
|
235 | 235 | transform: 'translate3d(' + perc + '%,0,0)'
|
|
340 | 340 |
|
341 | 341 | var queue = (function() {
|
342 | 342 | var pending = [];
|
343 | | - |
| 343 | + |
344 | 344 | function next() {
|
345 | 345 | var fn = pending.shift();
|
346 | 346 | if (fn) {
|
|
355 | 355 | })();
|
356 | 356 |
|
357 | 357 | /**
|
358 | | - * (Internal) Applies css properties to an element, similar to the jQuery |
| 358 | + * (Internal) Applies css properties to an element, similar to the jQuery |
359 | 359 | * css method.
|
360 | 360 | *
|
361 | | - * While this helper does assist with vendor prefixed property names, it |
| 361 | + * While this helper does assist with vendor prefixed property names, it |
362 | 362 | * does not perform any manipulation of values prior to setting styles.
|
363 | 363 | */
|
364 | 364 |
|
|
399 | 399 |
|
400 | 400 | return function(element, properties) {
|
401 | 401 | var args = arguments,
|
402 | | - prop, |
| 402 | + prop, |
403 | 403 | value;
|
404 | 404 |
|
405 | 405 | if (args.length == 2) {
|
|
430 | 430 | var oldList = classList(element),
|
431 | 431 | newList = oldList + name;
|
432 | 432 |
|
433 | | - if (hasClass(oldList, name)) return; |
| 433 | + if (hasClass(oldList, name)) return; |
434 | 434 |
|
435 | 435 | // Trim the opening space.
|
436 | 436 | element.className = newList.substring(1);
|
|
454 | 454 | }
|
455 | 455 |
|
456 | 456 | /**
|
457 | | - * (Internal) Gets a space separated list of the class names on the element. |
458 | | - * The list is wrapped with a single space on each end to facilitate finding |
| 457 | + * (Internal) Gets a space separated list of the class names on the element. |
| 458 | + * The list is wrapped with a single space on each end to facilitate finding |
459 | 459 | * matches within the list.
|
460 | 460 | */
|
461 | 461 |
|
462 | 462 | function classList(element) {
|
463 | | - return (' ' + (element.className || '') + ' ').replace(/\s+/gi, ' '); |
| 463 | + return (' ' + (element&&element.className || '') + ' ').replace(/\s+/gi, ' '); |
464 | 464 | }
|
465 | 465 |
|
466 | 466 | /**
|
|
473 | 473 |
|
474 | 474 | return NProgress;
|
475 | 475 | });
|
476 | | - |
0 commit comments