Skip to content

Commit

Permalink
#262 fix jsHint errors and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Oct 1, 2015
1 parent 7b2d843 commit fb08a40
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/iframeResizer.contentWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@
return myID;
},

getPageInfo: function getPageInfoF(callback){
pageInfoCallback = callback;
sendMsg(0,0,'pageInfo');
},

moveToAnchor: function moveToAnchorF(hash){
inPageLinks.findTarget(hash);
},
Expand All @@ -494,11 +499,6 @@
sendMsg(0,0,'message',JSON.stringify(msg),targetOrigin);
},

getPageInfo: function getPageInfoF(callback){
pageInfoCallback = callback
sendMsg(0,0,'pageInfo');
},

setHeightCalculationMethod: function setHeightCalculationMethodF(heightCalculationMethod){
heightCalcMode = heightCalculationMethod;
checkHeightMode();
Expand Down
24 changes: 13 additions & 11 deletions src/iframeResizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,19 @@
}

function sendPageInfoToIframe(){
var bodyPosition = document.body.getBoundingClientRect();
var iFramePosition = messageData.iframe.getBoundingClientRect();
var position = {
clientHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
clientWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
offsetLeft: parseInt(iFramePosition.left - bodyPosition.left),
offsetTop: parseInt(iFramePosition.top - bodyPosition.top),
scrollLeft: window.pageXOffset,
scrollTop: window.pageYOffset
};
trigger('Send Page Info','pageInfo:'+JSON.stringify(position), settings[iframeId].iframe,iframeId);
var
bodyPosition = document.body.getBoundingClientRect(),
iFramePosition = messageData.iframe.getBoundingClientRect(),
position = JSON.stringify({
clientHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
clientWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
scrollLeft: window.pageXOffset,
scrollTop: window.pageYOffset;
});

trigger('Send Page Info','pageInfo:' + position, settings[iframeId].iframe, iframeId);
}

function checkIFrameExists(){
Expand Down

0 comments on commit fb08a40

Please sign in to comment.