Adds window load listener to handle icon font visibility while it's not ready.

This commit is contained in:
Mateus Machado Luna 2019-02-08 11:48:31 -02:00
parent e094b2ce55
commit 5db5af76fd
4 changed files with 47 additions and 2 deletions

View File

@ -103,3 +103,22 @@ new Vue({
router, router,
render: h => h(AdminPage) render: h => h(AdminPage)
}); });
// Display Icons only once everything is loaded
function listen(evnt, elem, func) {
if (elem.addEventListener) // W3C DOM
elem.addEventListener(evnt,func,false);
else if (elem.attachEvent) { // IE DOM
var r = elem.attachEvent("on"+evnt, func);
return r;
}
else {
jQuery('head').append('<style>.tainacan-icon{ opacity: 1 !important; }</style>');
}
}
listen("load", window, function() {
var iconsStyle = document.createElement("style");
iconsStyle.setAttribute('type', 'text/css');
iconsStyle.innerText = '.tainacan-icon{ opacity: 1 !important; }';
document.head.appendChild(iconsStyle);
});

View File

@ -130,3 +130,22 @@ export const ThemeItemsListing = new Vue({
} }
}); });
// Display Icons only once everything is loaded
function listen(evnt, elem, func) {
if (elem.addEventListener) // W3C DOM
elem.addEventListener(evnt,func,false);
else if (elem.attachEvent) { // IE DOM
var r = elem.attachEvent("on"+evnt, func);
return r;
}
else {
jQuery('head').append('<style>.tainacan-icon{ opacity: 1 !important; }</style>');
}
}
listen("load", window, function() {
var iconsStyle = document.createElement("style");
iconsStyle.setAttribute('type', 'text/css');
iconsStyle.innerText = '.tainacan-icon{ opacity: 1 !important; }';
document.head.appendChild(iconsStyle);
});

View File

@ -51,6 +51,9 @@ html {
} }
// Tainacan Loading // Tainacan Loading
.tainacan-icon {
opacity: 0; // Will make it 1 once window.load is done;
}
.loading-overlay { .loading-overlay {
z-index: 9999999999; z-index: 9999999999;
} }

View File

@ -67,6 +67,10 @@ export default {
display: flex; display: flex;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
.tainacan-icon {
opacity: 0; // Will make it 1 once window.load is done;
}
a, a:not([href]){ color: $secondary } a, a:not([href]){ color: $secondary }
a:hover, a:hover:not([href]) { a:hover, a:hover:not([href]) {
cursor: pointer; cursor: pointer;