@@ -104,10 +104,11 @@ ZoomIn.propTypes = {
104104
105105var ZoomOut = function ZoomOut ( _ref ) {
106106 var scale = _ref . scale ,
107+ minScale = _ref . minScale ,
107108 css = _ref . css ,
108109 handleZoomOut = _ref . handleZoomOut ;
109110
110- var zoomOutClass = '' + ( css ? css : 'btn btn-sm btn-link text-white pr-2' ) + ( scale === 1 ? ' disabled' : '' ) ;
111+ var zoomOutClass = '' + ( css ? css : 'btn btn-sm btn-link text-white pr-2' ) + ( scale === minScale ? ' disabled' : '' ) ;
111112
112113 return React . createElement (
113114 'button' ,
@@ -127,10 +128,11 @@ ZoomOut.propTypes = {
127128
128129var ResetZoom = function ResetZoom ( _ref ) {
129130 var scale = _ref . scale ,
131+ defaultScale = _ref . defaultScale ,
130132 css = _ref . css ,
131133 handleResetZoom = _ref . handleResetZoom ;
132134
133- var resetZoomClass = ( css ? css : 'btn btn-sm btn-link text-white px-2' ) + '\n ' + ( scale === 1 ? ' disabled' : '' ) ;
135+ var resetZoomClass = ( css ? css : 'btn btn-sm btn-link text-white px-2' ) + '\n ' + ( scale === defaultScale ? ' disabled' : '' ) ;
134136
135137 return React . createElement (
136138 'button' ,
@@ -234,7 +236,9 @@ var Navigation = function Navigation(_ref) {
234236 var page = _ref . page ,
235237 pages = _ref . pages ,
236238 scale = _ref . scale ,
239+ defaultScale = _ref . defaultScale ,
237240 maxScale = _ref . maxScale ,
241+ minScale = _ref . minScale ,
238242 rotationAngle = _ref . rotationAngle ,
239243 hideZoom = _ref . hideZoom ,
240244 hideRotation = _ref . hideRotation ,
@@ -263,11 +267,13 @@ var Navigation = function Navigation(_ref) {
263267 { className : 'btn-group' , role : 'group' } ,
264268 React . createElement ( ZoomOut , {
265269 scale : scale ,
270+ minScale : minScale ,
266271 css : css . zoomOutBtn ,
267272 handleZoomOut : handleZoomOut
268273 } ) ,
269274 React . createElement ( ResetZoom , {
270275 scale : scale ,
276+ defaultScale : defaultScale ,
271277 css : css . resetZoomBtn ,
272278 handleResetZoom : handleResetZoom
273279 } ) ,
@@ -512,8 +518,10 @@ var PDFViewer = function (_React$Component) {
512518 pages : 0 ,
513519 page : 1 ,
514520 scale : 1 ,
521+ defaultScale : 1 ,
515522 scaleStep : 1 ,
516523 maxScale : 3 ,
524+ minScale : 1 ,
517525 rotationAngle : 0
518526 } , _this . onDocumentComplete = function ( pages ) {
519527 _this . setState ( {
@@ -551,14 +559,14 @@ var PDFViewer = function (_React$Component) {
551559 }
552560 } , _this . handleResetZoom = function ( ) {
553561 _this . setState ( {
554- scale : 1
562+ scale : _this . state . defaultScale
555563 } ) ;
556564
557565 if ( _this . props . onZoom ) {
558- _this . props . onZoom ( 1 ) ;
566+ _this . props . onZoom ( _this . state . defaultScale ) ;
559567 }
560568 } , _this . handleZoomOut = function ( ) {
561- if ( _this . state . scale > 1 ) {
569+ if ( _this . state . scale > _this . state . minScale ) {
562570 _this . setState ( {
563571 scale : _this . state . scale - _this . state . scaleStep
564572 } ) ;
@@ -607,8 +615,10 @@ var PDFViewer = function (_React$Component) {
607615 pages : null ,
608616 page : this . props . page || this . state . page ,
609617 scale : this . props . scale || this . state . scale ,
618+ defaultScale : this . props . scale || this . state . scale ,
610619 scaleStep : this . props . scaleStep || this . state . scaleStep ,
611620 maxScale : this . props . maxScale || this . state . maxScale ,
621+ minScale : this . props . minScale || this . state . minScale ,
612622 rotationAngle : this . props . rotationAngle || this . state . rotationAngle
613623 } ) ;
614624 }
@@ -630,7 +640,9 @@ var PDFViewer = function (_React$Component) {
630640 page = _state . page ,
631641 pages = _state . pages ,
632642 scale = _state . scale ,
643+ defaultScale = _state . defaultScale ,
633644 maxScale = _state . maxScale ,
645+ minScale = _state . minScale ,
634646 rotationAngle = _state . rotationAngle ;
635647
636648
@@ -654,7 +666,9 @@ var PDFViewer = function (_React$Component) {
654666 page : page ,
655667 pages : pages ,
656668 scale : scale ,
669+ defaultScale : defaultScale ,
657670 maxScale : maxScale ,
671+ minScale : minScale ,
658672 rotationAngle : rotationAngle ,
659673 hideZoom : hideZoom ,
660674 hideRotation : hideRotation ,
@@ -671,7 +685,9 @@ var PDFViewer = function (_React$Component) {
671685 page : page ,
672686 pages : pages ,
673687 scale : scale ,
688+ defaultScale : defaultScale ,
674689 maxScale : maxScale ,
690+ minScale : minScale ,
675691 rotationAngle : rotationAngle ,
676692 hideZoom : hideZoom ,
677693 hideRotation : hideRotation ,
@@ -747,6 +763,7 @@ PDFViewer.propTypes = {
747763 scale : PropTypes . number ,
748764 scaleStep : PropTypes . number ,
749765 maxScale : PropTypes . number ,
766+ minScale : PropTypes . number ,
750767 css : PropTypes . string ,
751768 canvasCss : PropTypes . string ,
752769 rotationAngle : PropTypes . number ,
0 commit comments