Merge pull request #6327 from Snuffleupagus/viewer-sidebar-prevent-switching-to-disabled-views
Prevent switching to disabled views (i.e. outline or attachments) in the sidebar
This commit is contained in:
commit
26b9205c7e
@ -1040,29 +1040,27 @@ var PDFViewerApplication = {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'outline':
|
case 'outline':
|
||||||
|
if (outlineButton.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
thumbsButton.classList.remove('toggled');
|
thumbsButton.classList.remove('toggled');
|
||||||
outlineButton.classList.add('toggled');
|
outlineButton.classList.add('toggled');
|
||||||
attachmentsButton.classList.remove('toggled');
|
attachmentsButton.classList.remove('toggled');
|
||||||
thumbsView.classList.add('hidden');
|
thumbsView.classList.add('hidden');
|
||||||
outlineView.classList.remove('hidden');
|
outlineView.classList.remove('hidden');
|
||||||
attachmentsView.classList.add('hidden');
|
attachmentsView.classList.add('hidden');
|
||||||
|
|
||||||
if (outlineButton.getAttribute('disabled')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'attachments':
|
case 'attachments':
|
||||||
|
if (attachmentsButton.disabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
thumbsButton.classList.remove('toggled');
|
thumbsButton.classList.remove('toggled');
|
||||||
outlineButton.classList.remove('toggled');
|
outlineButton.classList.remove('toggled');
|
||||||
attachmentsButton.classList.add('toggled');
|
attachmentsButton.classList.add('toggled');
|
||||||
thumbsView.classList.add('hidden');
|
thumbsView.classList.add('hidden');
|
||||||
outlineView.classList.add('hidden');
|
outlineView.classList.add('hidden');
|
||||||
attachmentsView.classList.remove('hidden');
|
attachmentsView.classList.remove('hidden');
|
||||||
|
|
||||||
if (attachmentsButton.getAttribute('disabled')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user