Skip to content

Commit

Permalink
Merge pull request #6195 from Snuffleupagus/viewer-remove-updateScale…
Browse files Browse the repository at this point in the history
…Controls

Remove `PDFViewerApplication.updateScaleControls` (issue 6158)
  • Loading branch information
timvandermeij committed Jul 11, 2015
2 parents 6c1906f + 5cb1587 commit d091263
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions web/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ var PDFViewerApplication = {
/** @type {PDFHistory} */
pdfHistory: null,
pageRotation: 0,
updateScaleControls: true,
isInitialViewSet: false,
animationStartedPromise: null,
preferenceSidebarViewOnLoad: SidebarView.NONE,
Expand Down Expand Up @@ -1175,9 +1174,7 @@ var PDFViewerApplication = {
},

setScale: function (value, resetAutoSettings) {
this.updateScaleControls = !!resetAutoSettings;
this.pdfViewer.currentScaleValue = value;
this.updateScaleControls = true;
},

rotatePages: function pdfViewRotatePages(delta) {
Expand Down Expand Up @@ -1752,18 +1749,6 @@ window.addEventListener('scalechange', function scalechange(evt) {
document.getElementById('zoomOut').disabled = (evt.scale === MIN_SCALE);
document.getElementById('zoomIn').disabled = (evt.scale === MAX_SCALE);

var customScaleOption = document.getElementById('customScaleOption');
customScaleOption.selected = false;

if (!PDFViewerApplication.updateScaleControls &&
(document.getElementById('pageAutoOption').selected ||
document.getElementById('pageActualOption').selected ||
document.getElementById('pageFitOption').selected ||
document.getElementById('pageWidthOption').selected)) {
updateViewarea();
return;
}

if (evt.presetValue) {
selectScaleOption(evt.presetValue);
updateViewarea();
Expand All @@ -1772,6 +1757,7 @@ window.addEventListener('scalechange', function scalechange(evt) {

var predefinedValueFound = selectScaleOption('' + evt.scale);
if (!predefinedValueFound) {
var customScaleOption = document.getElementById('customScaleOption');
var customScale = Math.round(evt.scale * 10000) / 100;
customScaleOption.textContent =
mozL10n.get('page_scale_percent', { scale: customScale }, '{{scale}}%');
Expand Down

0 comments on commit d091263

Please sign in to comment.