Skip to content

Commit

Permalink
Fix containInline mobile scroll support.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstraw committed Dec 29, 2015
1 parent ea5dd9f commit bedee42
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
13 changes: 4 additions & 9 deletions dist/Drift.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,11 @@ var ZoomPane = (function () {
var maxTop = -(this.imgEl.clientHeight - this.el.clientHeight);

if (this.el.parentElement === this.settings.inlineContainer) {
var scrollX = window.scrollX;
var scrollY = window.scrollY;
var scrollX = isTouch ? 0 : window.scrollX;
var scrollY = isTouch ? 0 : window.scrollY;

var inlineLeft = triggerRect.left + percentageOffsetX * triggerRect.width - this.el.clientWidth / 2 + this.settings.inlineOffsetX;
var inlineTop = triggerRect.top + percentageOffsetY * triggerRect.height - this.el.clientHeight / 2 + this.settings.inlineOffsetY;

if (!isTouch) {
inlineLeft += scrollX;
inlineTop += scrollY;
}
var inlineLeft = triggerRect.left + percentageOffsetX * triggerRect.width - this.el.clientWidth / 2 + this.settings.inlineOffsetX + scrollX;
var inlineTop = triggerRect.top + percentageOffsetY * triggerRect.height - this.el.clientHeight / 2 + this.settings.inlineOffsetY + scrollY;

if (this.settings.containInline) {
var elRect = this.el.getBoundingClientRect();
Expand Down
Loading

0 comments on commit bedee42

Please sign in to comment.