Don't allow to rotate or delete pages for read-only PDF
This commit is contained in:
parent
28329aa785
commit
29dd0cf5dc
1 changed files with 4 additions and 0 deletions
|
@ -893,6 +893,7 @@ class ReaderInstance {
|
|||
// Rotate Left
|
||||
menuitem = this._window.document.createElement('menuitem');
|
||||
menuitem.setAttribute('label', Zotero.getString('pdfReader.rotateLeft'));
|
||||
menuitem.setAttribute('disabled', this._isReadOnly());
|
||||
menuitem.addEventListener('command', async () => {
|
||||
this._postMessage({ action: 'reloading' });
|
||||
await Zotero.PDFWorker.rotatePages(this._itemID, data.pageIndexes, 270, true);
|
||||
|
@ -902,6 +903,7 @@ class ReaderInstance {
|
|||
// Rotate Right
|
||||
menuitem = this._window.document.createElement('menuitem');
|
||||
menuitem.setAttribute('label', Zotero.getString('pdfReader.rotateRight'));
|
||||
menuitem.setAttribute('disabled', this._isReadOnly());
|
||||
menuitem.addEventListener('command', async () => {
|
||||
this._postMessage({ action: 'reloading' });
|
||||
await Zotero.PDFWorker.rotatePages(this._itemID, data.pageIndexes, 90, true);
|
||||
|
@ -911,6 +913,7 @@ class ReaderInstance {
|
|||
// Rotate 180
|
||||
menuitem = this._window.document.createElement('menuitem');
|
||||
menuitem.setAttribute('label', Zotero.getString('pdfReader.rotate180'));
|
||||
menuitem.setAttribute('disabled', this._isReadOnly());
|
||||
menuitem.addEventListener('command', async () => {
|
||||
this._postMessage({ action: 'reloading' });
|
||||
await Zotero.PDFWorker.rotatePages(this._itemID, data.pageIndexes, 180, true);
|
||||
|
@ -922,6 +925,7 @@ class ReaderInstance {
|
|||
// Delete
|
||||
menuitem = this._window.document.createElement('menuitem');
|
||||
menuitem.setAttribute('label', Zotero.getString('general.delete'));
|
||||
menuitem.setAttribute('disabled', this._isReadOnly());
|
||||
menuitem.addEventListener('command', async () => {
|
||||
if (this.promptToDeletePages(data.pageIndexes.length)) {
|
||||
this._postMessage({ action: 'reloading' });
|
||||
|
|
Loading…
Reference in a new issue