diff options
author | Nivesh Rajbhandari | 2012-05-04 15:33:29 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-05-04 15:33:29 -0700 |
commit | ad94ec51c81badeba2b0f870cad8a0eec7878ebd (patch) | |
tree | 35c52d44d2c5399ea4019582af3fb55a53ee05c8 /node_modules/montage/ui/loader.reel/loader.js | |
parent | 3ad9024bcfce76e28816daa02bac14fc8985ca62 (diff) | |
parent | 3ebed34665fa73b0ce613b400f3029ebf4476439 (diff) | |
download | ninja-ad94ec51c81badeba2b0f870cad8a0eec7878ebd.tar.gz |
Merge branch 'refs/heads/dom-architecture-master' into Dom-Architecture
Diffstat (limited to 'node_modules/montage/ui/loader.reel/loader.js')
-rwxr-xr-x | node_modules/montage/ui/loader.reel/loader.js | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/node_modules/montage/ui/loader.reel/loader.js b/node_modules/montage/ui/loader.reel/loader.js index 941c17da..921c3781 100755 --- a/node_modules/montage/ui/loader.reel/loader.js +++ b/node_modules/montage/ui/loader.reel/loader.js | |||
@@ -438,11 +438,33 @@ exports.Loader = Montage.create(Component, /** @lends module:montage/ui/loader.L | |||
438 | } | 438 | } |
439 | }, | 439 | }, |
440 | 440 | ||
441 | /** | ||
442 | Boolean that specifies whether to remove the loading content when load is completed | ||
443 | */ | ||
444 | removeContentOnLoad: { | ||
445 | value: true | ||
446 | }, | ||
447 | |||
448 | _forceContentRemoval: { | ||
449 | enumerable: false, | ||
450 | value: false | ||
451 | }, | ||
452 | |||
441 | _contentToRemove: { | 453 | _contentToRemove: { |
442 | enumerable: false, | 454 | enumerable: false, |
443 | value: null | 455 | value: null |
444 | }, | 456 | }, |
445 | 457 | ||
458 | /** | ||
459 | Forces a manual removal of loading content | ||
460 | */ | ||
461 | removeContent: { | ||
462 | value: function() { | ||
463 | this._forceContentRemoval = true; | ||
464 | this.needsDraw = true; | ||
465 | } | ||
466 | }, | ||
467 | |||
446 | draw: { | 468 | draw: { |
447 | value: function() { | 469 | value: function() { |
448 | // start loading the mainComponent if we haven't already | 470 | // start loading the mainComponent if we haven't already |
@@ -464,9 +486,11 @@ exports.Loader = Montage.create(Component, /** @lends module:montage/ui/loader.L | |||
464 | this.element.classList.remove(BOOTSTRAPPING_CLASS_NAME); | 486 | this.element.classList.remove(BOOTSTRAPPING_CLASS_NAME); |
465 | this.element.classList.remove(LOADING_CLASS_NAME); | 487 | this.element.classList.remove(LOADING_CLASS_NAME); |
466 | 488 | ||
467 | this._contentToRemove.extractContents(); | 489 | if(this.removeContentOnLoad || this._forceContentRemoval) { |
468 | this._contentToRemove.detach(); | 490 | this._contentToRemove.extractContents(); |
469 | this._contentToRemove = null; | 491 | this._contentToRemove.detach(); |
492 | this._contentToRemove = null; | ||
493 | } | ||
470 | 494 | ||
471 | this.element.classList.add(LOADED_CLASS_NAME); | 495 | this.element.classList.add(LOADED_CLASS_NAME); |
472 | } | 496 | } |