hide loader only once the initial note is loaded

This commit is contained in:
azivner 2017-11-06 22:21:11 -05:00
parent 0869caa03c
commit 43a6a52ead
2 changed files with 21 additions and 12 deletions

View File

@ -91,16 +91,23 @@ function isElectron() {
return window && window.process && window.process.type; return window && window.process && window.process.type;
} }
$(document).ready(() => { let appShown = false;
$("#container").show();
// Get a reference to the loader's div function showAppIfHidden() {
const loaderDiv = document.getElementById("loader-wrapper"); if (!appShown) {
// When the transition ends remove loader's div from display appShown = true;
// so that we can access the map with gestures or clicks
loaderDiv.addEventListener("transitionend", function(){ $("#container").show();
loaderDiv.style.display = "none";
}, true); // Get a reference to the loader's div
// Kick off the CSS transition const loaderDiv = document.getElementById("loader-wrapper");
loaderDiv.style.opacity = 0.0; // When the transition ends remove loader's div from display
}); // so that we can access the map with gestures or clicks
loaderDiv.addEventListener("transitionend", function(){
loaderDiv.style.display = "none";
}, true);
// Kick off the CSS transition
loaderDiv.style.opacity = 0.0;
}
}

View File

@ -227,6 +227,8 @@ const noteEditor = (function() {
noteChangeDisabled = false; noteChangeDisabled = false;
setNoteBackgroundIfEncrypted(currentNote); setNoteBackgroundIfEncrypted(currentNote);
showAppIfHidden();
} }
async function loadNote(noteId) { async function loadNote(noteId) {