Prechádzať zdrojové kódy

Added apploaded event to signify when the app has completed loading

n1474335 8 rokov pred
rodič
commit
81f2a460ed
2 zmenil súbory, kde vykonal 8 pridanie a 0 odobranie
  1. 4 0
      src/web/App.js
  2. 4 0
      src/web/Manager.js

+ 4 - 0
src/web/App.js

@@ -60,6 +60,8 @@ App.prototype.setup = function() {
 
 
 /**
 /**
  * Fires once all setup activities have completed.
  * Fires once all setup activities have completed.
+ *
+ * @fires Manager#apploaded
  */
  */
 App.prototype.loaded = function() {
 App.prototype.loaded = function() {
     // Trigger CSS animations to remove preloader
     // Trigger CSS animations to remove preloader
@@ -74,6 +76,8 @@ App.prototype.loaded = function() {
 
 
     // Clear the loading message interval
     // Clear the loading message interval
     clearInterval(window.loadingMsgsInt);
     clearInterval(window.loadingMsgsInt);
+
+    document.dispatchEvent(this.manager.apploaded);
 };
 };
 
 
 
 

+ 4 - 0
src/web/Manager.js

@@ -27,6 +27,10 @@ const Manager = function(app) {
      * @event Manager#appstart
      * @event Manager#appstart
      */
      */
     this.appstart = new CustomEvent("appstart", {bubbles: true});
     this.appstart = new CustomEvent("appstart", {bubbles: true});
+    /**
+     * @event Manager#apploaded
+     */
+    this.apploaded = new CustomEvent("apploaded", {bubbles: true});
     /**
     /**
      * @event Manager#operationadd
      * @event Manager#operationadd
      */
      */