Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
a-doc-editor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramdayal Munda
a-doc-editor
Commits
35ca9764
Commit
35ca9764
authored
Dec 19, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added loader screen
parent
9c22d9bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
3 deletions
+39
-3
a-doc-editor.css
dist/assets/a-doc-editor.css
+17
-2
a-doc-editor.js
dist/assets/a-doc-editor.js
+22
-1
No files found.
dist/assets/a-doc-editor.css
View file @
35ca9764
...
...
@@ -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
;
}
dist/assets/a-doc-editor.js
View file @
35ca9764
...
...
@@ -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() {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment