Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
fix(toolbar): use prefix translate for scroll-shrink in safari 8
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Dec 20, 2015
1 parent 9ae1a42 commit 9e14280
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ng2-material/components/toolbar/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,12 @@ export class MdToolbar implements AfterViewInit, OnChanges, OnDestroy {
Math.max(0, this._currentY + scrollTop - this._previousScrollTop)
);

DOM.setStyle(this.el.nativeElement, 'transform', `translate3d(0,${-this._currentY * this.mdShrinkSpeed}px,0)`);
DOM.setStyle(this._content, 'transform', `translate3d(0,${(this._toolbarHeight - this._currentY) * this.mdShrinkSpeed}px,0)`);
let toolbarXform = `translate3d(0,${-this._currentY * this.mdShrinkSpeed}px,0)`;
let contentXform = `translate3d(0,${(this._toolbarHeight - this._currentY) * this.mdShrinkSpeed}px,0)`;
DOM.setStyle(this._content, '-webkit-transform', contentXform);
DOM.setStyle(this._content, 'transform', contentXform);
DOM.setStyle(this.el.nativeElement, '-webkit-transform', toolbarXform);
DOM.setStyle(this.el.nativeElement, 'transform', toolbarXform);

this._previousScrollTop = scrollTop;

Expand Down

0 comments on commit 9e14280

Please sign in to comment.