diff --git a/src/lib/viewers/doc/DocBaseViewer.js b/src/lib/viewers/doc/DocBaseViewer.js index ad4a1017b..c80a446f4 100644 --- a/src/lib/viewers/doc/DocBaseViewer.js +++ b/src/lib/viewers/doc/DocBaseViewer.js @@ -797,10 +797,6 @@ const MOBILE_MAX_CANVAS_SIZE = 2949120; // ~3MP 1920x1536 * @return {void} */ loadUI() { - if (this.isMobile) { - return; - } - this.controls = new Controls(this.containerEl); this.bindControlListeners(); this.initPageNumEl(); diff --git a/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js b/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js index b2f316acf..73be88922 100644 --- a/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js +++ b/src/lib/viewers/doc/__tests__/DocBaseViewer-test.js @@ -1210,12 +1210,6 @@ describe('src/lib/viewers/doc/DocBaseViewer', () => { expect(initPageNumElStub).to.be.called; expect(docBase.controls instanceof Controls).to.be.true; }); - - it('should disable controls if on a mobile browser', () => { - docBase.isMobile = true; - docBase.loadUI(); - expect(docBase.controls).to.be.undefined; - }); }); describe('showPageNumInput()', () => { diff --git a/src/lib/viewers/image/ImageBaseViewer.js b/src/lib/viewers/image/ImageBaseViewer.js index 2bacc9431..bf855979c 100644 --- a/src/lib/viewers/image/ImageBaseViewer.js +++ b/src/lib/viewers/image/ImageBaseViewer.js @@ -145,18 +145,12 @@ const CSS_CLASS_PANNABLE = 'pannable'; updateCursor() { if (this.isPannable) { this.isZoomable = false; - - if (!this.isMobile) { - this.imageEl.classList.add(CSS_CLASS_PANNABLE); - this.imageEl.classList.remove(CSS_CLASS_ZOOMABLE); - } + this.imageEl.classList.add(CSS_CLASS_PANNABLE); + this.imageEl.classList.remove(CSS_CLASS_ZOOMABLE); } else { this.isZoomable = true; - - if (!this.isMobile) { - this.imageEl.classList.remove(CSS_CLASS_PANNABLE); - this.imageEl.classList.add(CSS_CLASS_ZOOMABLE); - } + this.imageEl.classList.remove(CSS_CLASS_PANNABLE); + this.imageEl.classList.add(CSS_CLASS_ZOOMABLE); } } @@ -167,11 +161,6 @@ const CSS_CLASS_PANNABLE = 'pannable'; * @return {void} */ loadUI() { - // Temporarily disabling controls on mobile - if (this.isMobile) { - return; - } - this.controls = new Controls(this.containerEl); this.controls.add(__('zoom_out'), this.zoomOut, 'bp-image-zoom-out-icon', ICON_ZOOM_OUT); this.controls.add(__('zoom_in'), this.zoomIn, 'bp-image-zoom-in-icon', ICON_ZOOM_IN); diff --git a/src/lib/viewers/image/ImageViewer.js b/src/lib/viewers/image/ImageViewer.js index 3a9aa120b..b7906b9a4 100644 --- a/src/lib/viewers/image/ImageViewer.js +++ b/src/lib/viewers/image/ImageViewer.js @@ -245,11 +245,6 @@ const IMAGE_ZOOM_SCALE = 1.2; loadUI() { super.loadUI(); - // Temporarily disabling controls on mobile - if (this.isMobile) { - return; - } - this.controls.add(__('rotate_left'), this.rotateLeft, 'bp-image-rotate-left-icon', ICON_ROTATE_LEFT); this.controls.add( __('enter_fullscreen'), diff --git a/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js b/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js index 9c711951e..c007a3355 100644 --- a/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js +++ b/src/lib/viewers/image/__tests__/ImageBaseViewer-test.js @@ -127,21 +127,6 @@ describe('lib/viewers/image/ImageBaseViewer', () => { expect(imageBase.imageEl).to.have.class(CSS_CLASS_ZOOMABLE); expect(imageBase.imageEl).to.not.have.class(CSS_CLASS_PANNABLE); }); - - it('should update classes if using a mobile browser', () => { - imageBase.isMobile = true; - imageBase.isZoomable = true; - imageBase.isPannable = true; - - imageBase.updateCursor(); - expect(imageBase.isZoomable).to.have.been.false; - - imageBase.isZoomable = false; - imageBase.isPannable = false; - - imageBase.updateCursor(); - expect(imageBase.isZoomable).to.have.been.true; - }); }); describe('startPanning()', () => { @@ -222,12 +207,6 @@ describe('lib/viewers/image/ImageBaseViewer', () => { expect(imageBase.controls).to.not.be.undefined; expect(imageBase.controls.buttonRefs.length).to.equal(2); }); - - it('should disable controls if on a mobile browser', () => { - imageBase.isMobile = true; - imageBase.loadUI(); - expect(imageBase.controls).to.be.undefined; - }); }); describe('handleMouseDown()', () => { diff --git a/src/lib/viewers/image/__tests__/ImageViewer-test.js b/src/lib/viewers/image/__tests__/ImageViewer-test.js index 9485ff0a9..899f3427d 100644 --- a/src/lib/viewers/image/__tests__/ImageViewer-test.js +++ b/src/lib/viewers/image/__tests__/ImageViewer-test.js @@ -363,11 +363,8 @@ describe('lib/viewers/image/ImageViewer', () => { }); describe('loadUI()', () => { - beforeEach(() => { - image.boxAnnotationsLoaded = false; - }); - it('should load UI & controls for zoom', () => { + image.boxAnnotationsLoaded = false; image.annotator = null; image.loadUI(); @@ -376,12 +373,6 @@ describe('lib/viewers/image/ImageViewer', () => { expect(image.controls.buttonRefs.length).to.equal(5); expect(image.boxAnnotationsLoaded).to.be.false; }); - - it('should disable controls if on a mobile browser', () => { - image.isMobile = true; - image.loadUI(); - expect(image.controls).to.be.undefined; - }); }); describe('print()', () => {