Skip to content

Commit

Permalink
Replace iOS7orLower boolean with isIOS7
Browse files Browse the repository at this point in the history
Element.GetClientRects seems to be incorrect only on iOS 7.

Closes #264
  • Loading branch information
taye committed Sep 8, 2015
1 parent 75edaa6 commit 0b94aac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions interact.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,9 @@
supportsTouch &&
navigator.userAgent.match('Presto'),

// scrolling doesn't change the result of
// getBoundingClientRect/getClientRects on iOS <=7 but it does on iOS 8
isIOS7orLower = (/iP(hone|od|ad)/.test(navigator.platform)
&& /OS [1-7][^\d]/.test(navigator.appVersion)),
// scrolling doesn't change the result of getClientRects on iOS 7
isIOS7 = (/iP(hone|od|ad)/.test(navigator.platform)
&& /OS 7[^\d]/.test(navigator.appVersion)),

// prefix matchesSelector
prefixedMatchesSelector = 'matches' in Element.prototype?
Expand Down Expand Up @@ -714,7 +713,7 @@
function getElementRect (element) {
var clientRect = getElementClientRect(element);

if (!isIOS7orLower && clientRect) {
if (!isIOS7 && clientRect) {
var scroll = getScrollXY(getWindow(element));

clientRect.left += scroll.x;
Expand Down

0 comments on commit 0b94aac

Please sign in to comment.