From 2cb79090d1beb07017c0641da46953354d49cfb8 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 15 Dec 2015 09:51:58 -0400 Subject: [PATCH] Implement poor man's ngCloak based on app controller ngCloak is removed by angular when parsing the template, however this doesn't seem to be enough to keep the content hidden until the application is completely ready. We accomplish this by setting `display: none` to the `body` element and maing it display again when our main controller starts, at which point we know everything is up and running. --- build/browser/app.js | 3 +++ lib/browser/app.js | 3 +++ lib/index.html | 3 +-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/browser/app.js b/build/browser/app.js index 0db9cba5..41df4096 100644 --- a/build/browser/app.js +++ b/build/browser/app.js @@ -64,6 +64,9 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState this.restart(); + // We're ready to unhide the application now + document.querySelector('body').style.display = 'initial'; + this.selectImage = function() { return $q.when(dialog.selectImage()).then(function(image) { self.selection.setImage(image); diff --git a/lib/browser/app.js b/lib/browser/app.js index 1842a87b..3ce6ef54 100644 --- a/lib/browser/app.js +++ b/lib/browser/app.js @@ -63,6 +63,9 @@ app.controller('AppController', function($q, DriveScannerService, SelectionState this.restart(); + // We're ready to unhide the application now + document.querySelector('body').style.display = 'initial'; + this.selectImage = function() { return $q.when(dialog.selectImage()).then(function(image) { self.selection.setImage(image); diff --git a/lib/index.html b/lib/index.html index 2059e2e1..3ab86b32 100644 --- a/lib/index.html +++ b/lib/index.html @@ -3,7 +3,6 @@ Herostratus - @@ -15,7 +14,7 @@ - +