diff options
author | Valerio Virgillito | 2012-05-03 22:53:07 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-03 22:53:07 -0700 |
commit | 24b483db367291b72170f969de78efcb1a9b95bd (patch) | |
tree | a691a7803cefbfa76a6331a50cbeebcd16287d91 /node_modules/montage/ui/loader.reel/loader.js | |
parent | dc93269cfa7c315d22d85c8217e2412749643f28 (diff) | |
download | ninja-24b483db367291b72170f969de78efcb1a9b95bd.tar.gz |
integrating the latest montage version
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
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 | } |