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

@ -102,4 +102,23 @@ new Vue({
store,
router,
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

@ -129,4 +129,23 @@ 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-icon {
opacity: 0; // Will make it 1 once window.load is done;
}
.loading-overlay {
z-index: 9999999999;
}

View File

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