Adds window load listener to handle icon font visibility while it's not ready.
This commit is contained in:
parent
e094b2ce55
commit
5db5af76fd
|
@ -103,3 +103,22 @@ new Vue({
|
|||
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);
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue