mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-24 15:27:17 +00:00
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.
This commit is contained in:
parent
e01e3591e9
commit
2cb79090d1
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -3,7 +3,6 @@
|
||||
<head>
|
||||
<title>Herostratus</title>
|
||||
<link rel="stylesheet" type="text/css" href="../node_modules/flexboxgrid/dist/flexboxgrid.css">
|
||||
<link rel="stylesheet" type="text/css" href="../node_modules/angular/angular-csp.css">
|
||||
<link rel="stylesheet" type="text/css" href="../build/css/main.css">
|
||||
|
||||
<link rel="import" href="components/hero-badge.html">
|
||||
@ -15,7 +14,7 @@
|
||||
|
||||
<script src="../build/browser/app.js"></script>
|
||||
</head>
|
||||
<body ng-app="Herostratus" ng-controller="AppController as app" ng-cloak>
|
||||
<body ng-app="Herostratus" ng-controller="AppController as app" style="display: none">
|
||||
|
||||
<div class="content row middle-xs space-horizontal-large">
|
||||
<div class="col-xs">
|
||||
|
Loading…
x
Reference in New Issue
Block a user