Skip to content

Commit

Permalink
Clean up updateViewerViewport method (#5680)
Browse files Browse the repository at this point in the history
  • Loading branch information
muxin committed Oct 19, 2016
1 parent 894f147 commit 9ca3969
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
23 changes: 0 additions & 23 deletions src/service/viewport-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ export class Viewport {
this.boundThrottledScroll_ = this.throttledScroll_.bind(this);

this.viewer_.onViewportEvent(this.updateOnViewportEvent_.bind(this));
this.binding_.updateViewerViewport(this.viewer_);
this.binding_.updatePaddingTop(this.paddingTop_);

this.binding_.onScroll(this.scroll_.bind(this));
Expand Down Expand Up @@ -581,7 +580,6 @@ export class Viewport {
* @private
*/
updateOnViewportEvent_(event) {
this.binding_.updateViewerViewport(this.viewer_);
const paddingTop = event['paddingTop'];
const duration = event['duration'] || 0;
const curve = event['curve'];
Expand Down Expand Up @@ -774,12 +772,6 @@ export class ViewportBindingDef {
*/
onResize(unusedCallback) {}

/**
* Updates binding with the new viewer's viewport info.
* @param {!./viewer-impl.Viewer} unusedViewer
*/
updateViewerViewport(unusedViewer) {}

/**
* Updates binding with the new padding.
* @param {number} unusedPaddingTop
Expand Down Expand Up @@ -956,11 +948,6 @@ export class ViewportBindingNatural_ {
this.resizeObservable_.add(callback);
}

/** @override */
updateViewerViewport(unusedViewer) {
// Viewer's viewport is ignored since this window is fully accurate.
}

/** @override */
updatePaddingTop(paddingTop) {
this.win.document.documentElement.style.paddingTop = px(paddingTop);
Expand Down Expand Up @@ -1223,11 +1210,6 @@ export class ViewportBindingNaturalIosEmbed_ {
// single-doc mode.
}

/** @override */
updateViewerViewport(unusedViewer) {
// Viewer's viewport is ignored since this window is fully accurate.
}

/** @override */
hideViewerHeader(transient, lastPaddingTop) {
if (transient) {
Expand Down Expand Up @@ -1511,11 +1493,6 @@ export class ViewportBindingIosEmbedWrapper_ {
this.resizeObservable_.add(callback);
}

/** @override */
updateViewerViewport(unusedViewer) {
// Viewer's viewport is ignored since this window is fully accurate.
}

/** @override */
updatePaddingTop(paddingTop) {
this.wrapper_.style.paddingTop = px(paddingTop);
Expand Down
7 changes: 0 additions & 7 deletions test/functional/test-viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,6 @@ describe('Viewport', () => {
expect(showFixedLayerStub.callCount).to.equal(1);
});

it('should call binding.updateViewerViewport', () => {
const bindingMock = sandbox.mock(binding);
bindingMock.expects('updateViewerViewport').once();
viewerViewportHandler({paddingTop: 19});
bindingMock.verify();
});

it('should send scroll events', () => {
// 0 -> 6 -> 12 -> 16 -> 18
// scroll-10 scroll-20 scroll-30 2nd anim frame scroll-40
Expand Down

0 comments on commit 9ca3969

Please sign in to comment.