Merge pull request #18243 from calixteman/disable_ui_when_saving
Display a wait cursor when saving
This commit is contained in:
commit
e3caa3c6ee
19
web/app.js
19
web/app.js
@ -1139,12 +1139,19 @@ const PDFViewerApplication = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
downloadOrSave(options = {}) {
|
async downloadOrSave(options = {}) {
|
||||||
if (this.pdfDocument?.annotationStorage.size > 0) {
|
// In the Firefox case, this method MUST always trigger a download.
|
||||||
this.save(options);
|
// When the user is closing a modified and unsaved document, we display a
|
||||||
} else {
|
// prompt asking for saving or not. In case they save, we must wait for
|
||||||
this.download(options);
|
// saving to complete before closing the tab.
|
||||||
}
|
// So in case this function does not trigger a download, we must trigger a
|
||||||
|
// a message and change PdfjsChild.sys.mjs to take it into account.
|
||||||
|
const { classList } = this.appConfig.appContainer;
|
||||||
|
classList.add("wait");
|
||||||
|
await (this.pdfDocument?.annotationStorage.size > 0
|
||||||
|
? this.save(options)
|
||||||
|
: this.download(options));
|
||||||
|
classList.remove("wait");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -223,6 +223,15 @@ body {
|
|||||||
body {
|
body {
|
||||||
background-color: var(--body-bg-color);
|
background-color: var(--body-bg-color);
|
||||||
scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color);
|
scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color);
|
||||||
|
|
||||||
|
&.wait::before {
|
||||||
|
content: "";
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 100000;
|
||||||
|
cursor: wait;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden,
|
.hidden,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user