Skip to content

Commit

Permalink
Upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Mar 1, 2023
1 parent 997f0e6 commit da2a6bb
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 126 deletions.
122 changes: 61 additions & 61 deletions js/iframeResizer.contentWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
; (function (undefined) {
;(function (undefined) {
if (typeof window === 'undefined') return // don't run for server side render

var autoResize = true,
Expand Down Expand Up @@ -57,8 +57,8 @@
onMessage = function () {
warn('onMessage function not defined')
},
onReady = function () { },
onPageInfo = function () { },
onReady = function () {},
onPageInfo = function () {},
customCalcMethods = {
height: function () {
warn('Custom height calculation function not defined')
Expand All @@ -72,7 +72,7 @@
eventHandlersByName = {},
passiveSupported = false

function noop() { }
function noop() {}

try {
var options = Object.create(
Expand Down Expand Up @@ -225,10 +225,10 @@
delete this[key]
warn(
"Deprecated: '" +
key +
"' has been renamed '" +
name +
"'. The old method will be removed in the next major version."
key +
"' has been renamed '" +
name +
"'. The old method will be removed in the next major version."
)
}
}
Expand Down Expand Up @@ -334,8 +334,8 @@

log(
capitalizeFirstLetter(options.method) +
' event listener: ' +
options.eventType
' event listener: ' +
options.eventType
)
}

Expand Down Expand Up @@ -551,11 +551,11 @@

log(
'Moving to in page link (#' +
hash +
') at x: ' +
jumpPosition.x +
' y: ' +
jumpPosition.y
hash +
') at x: ' +
jumpPosition.x +
' y: ' +
jumpPosition.y
)
sendMsg(jumpPosition.y, jumpPosition.x, 'scrollToOffset') // X&Y reversed at sendMsg uses height/width
}
Expand All @@ -569,8 +569,8 @@
if (undefined === target) {
log(
'In page link (#' +
hash +
') not found in iFrame, so sending to parent'
hash +
') not found in iFrame, so sending to parent'
)
sendMsg(0, 0, 'inPageLink', '#' + hash)
} else {
Expand Down Expand Up @@ -687,7 +687,7 @@
onPageInfo = callback
sendMsg(0, 0, 'pageInfo')
} else {
onPageInfo = function () { }
onPageInfo = function () {}
sendMsg(0, 0, 'pageInfoStop')
}
},
Expand Down Expand Up @@ -937,57 +937,57 @@
}

var getHeight = {
bodyOffset: function getBodyOffsetHeight() {
return (
document.body.offsetHeight +
getComputedStyle('marginTop') +
getComputedStyle('marginBottom')
)
},
bodyOffset: function getBodyOffsetHeight() {
return (
document.body.offsetHeight +
getComputedStyle('marginTop') +
getComputedStyle('marginBottom')
)
},

offset: function () {
return getHeight.bodyOffset() // Backwards compatibility
},
offset: function () {
return getHeight.bodyOffset() // Backwards compatibility
},

bodyScroll: function getBodyScrollHeight() {
return document.body.scrollHeight
},
bodyScroll: function getBodyScrollHeight() {
return document.body.scrollHeight
},

custom: function getCustomWidth() {
return customCalcMethods.height()
},
custom: function getCustomWidth() {
return customCalcMethods.height()
},

documentElementOffset: function getDEOffsetHeight() {
return document.documentElement.offsetHeight
},
documentElementOffset: function getDEOffsetHeight() {
return document.documentElement.offsetHeight
},

documentElementScroll: function getDEScrollHeight() {
return document.documentElement.scrollHeight
},
documentElementScroll: function getDEScrollHeight() {
return document.documentElement.scrollHeight
},

max: function getMaxHeight() {
return Math.max.apply(null, getAllMeasurements(getHeight))
},
max: function getMaxHeight() {
return Math.max.apply(null, getAllMeasurements(getHeight))
},

min: function getMinHeight() {
return Math.min.apply(null, getAllMeasurements(getHeight))
},
min: function getMinHeight() {
return Math.min.apply(null, getAllMeasurements(getHeight))
},

grow: function growHeight() {
return getHeight.max() // Run max without the forced downsizing
},
grow: function growHeight() {
return getHeight.max() // Run max without the forced downsizing
},

lowestElement: function getBestHeight() {
return Math.max(
getHeight.bodyOffset() || getHeight.documentElementOffset(),
getMaxElement('bottom', getAllElements())
)
},
lowestElement: function getBestHeight() {
return Math.max(
getHeight.bodyOffset() || getHeight.documentElementOffset(),
getMaxElement('bottom', getAllElements())
)
},

taggedElement: function getTaggedElementsHeight() {
return getTaggedElements('bottom', 'data-iframe-height')
}
},
taggedElement: function getTaggedElementsHeight() {
return getTaggedElements('bottom', 'data-iframe-height')
}
},
getWidth = {
bodyScroll: function getBodyScrollWidth() {
return document.body.scrollWidth
Expand Down Expand Up @@ -1278,8 +1278,8 @@
} else {
log(
'Ignored message of type "' +
getMessageType() +
'". Received before initialization.'
getMessageType() +
'". Received before initialization.'
)
}
}
Expand Down
Loading

0 comments on commit da2a6bb

Please sign in to comment.