Commit 35ca9764 by ramdayalmunda

added loader screen

parent 9c22d9bd
......@@ -171,4 +171,20 @@
/* Set the color of the scrollbar track */
border-radius: 5px;
/* Set border radius */
}
\ No newline at end of file
}
.full-screen-overlay {
position: fixed;
top: 0;
left: 0;
height: 100vh;
width: 100vw;
background-color: rgba(0, 0, 0, 0.7); /* Optional background color */
display: flex;
justify-content: center;
align-items: center;
color: white;
font-size: xx-large;
}
......@@ -22,6 +22,7 @@ var ADocEditor = function (customConfig) {
var fontFamilyDropdown = null
var fontList = []
var fontSize;
var fullScreenLoadingOverlay;
var defaultConfig = {
element: "",
......@@ -210,6 +211,10 @@ var ADocEditor = function (customConfig) {
fontSize = container.querySelector('[adc-action="font-size-set"]')
fullScreenLoadingOverlay = document.createElement('div')
fullScreenLoadingOverlay.innerText = 'Loading...'
fullScreenLoadingOverlay.setAttribute('class', 'full-screen-overlay')
bindGlobalEvents()
......@@ -705,7 +710,7 @@ var ADocEditor = function (customConfig) {
async function generatePDF(file) {
showLoader()
let embededFonts = {}
......@@ -807,6 +812,7 @@ var ADocEditor = function (customConfig) {
downloadLink.style.display = "none"; // Keep it hidden
downloadLink.click()
document.body.removeChild(downloadLink)
hideLoader()
}
function addFonts(paths, name) {
......@@ -931,6 +937,21 @@ var ADocEditor = function (customConfig) {
})
}
function showLoader(){
container.append(fullScreenLoadingOverlay)
fullScreenLoadingOverlay.addEventListener('mousedown', preventEvents, true)
fullScreenLoadingOverlay.addEventListener('keydown', preventEvents, true)
}
function hideLoader(){
fullScreenLoadingOverlay.removeEventListener('mousedown', preventEvents, true)
fullScreenLoadingOverlay.removeEventListener('keydown', preventEvents, true)
fullScreenLoadingOverlay.remove()
}
function preventEvents(event) {
event.preventDefault();
event.stopPropagation();
}
inititalize(customConfig)
function destory() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment