Skip to content

Commit

Permalink
Release v3.5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjbradshaw committed Feb 16, 2017
1 parent 9610402 commit be044b4
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ The parentIFrame methods object in the iFrame is now always available and the `e

## Version History

* v3.5.9 Show warning message if no response from iFrame. [#463](https://github.com/davidjbradshaw/iframe-resizer/issues/463) Suppress warning message about nested iFrame when code loaded via module [[Sergey Pereskokov](SerjoPepper)]. [#461](https://github.com/davidjbradshaw/iframe-resizer/issues/461) Don't run for serverside render.
* v3.5.9 Show warning message if no response from iFrame. [#463](https://github.com/davidjbradshaw/iframe-resizer/issues/463) Suppress warning message when code loaded via module [[Sergey Pereskokov](SerjoPepper)]. [#461](https://github.com/davidjbradshaw/iframe-resizer/issues/461) Don't run for server-side render.
* v3.5.8 [#315](https://github.com/davidjbradshaw/iframe-resizer/issues/315) Allow Scrolling to be set to 'auto'.
* v3.5.7 [#438](https://github.com/davidjbradshaw/iframe-resizer/issues/438) Check jQuery pluging wrapper not already loaded. [#423](https://github.com/davidjbradshaw/iframe-resizer/issues/423) Properly remove event listeners [[Aaron Hardy](Aaronius)]. [#401](https://github.com/davidjbradshaw/iframe-resizer/issues/401) Make tagged element fall back to all elements if tag not found. [#381](https://github.com/davidjbradshaw/iframe-resizer/issues/381) Fixing disconnect when iframe is missing temporarly [[Jeff Hicken](jhicken)]. Added warnings for missing iFrame and deprecated options.
* v3.5.5 [#373](https://github.com/davidjbradshaw/iframe-resizer/issues/373) Add option for custom size calculation methods in iFrame. [#374](https://github.com/davidjbradshaw/iframe-resizer/issues/374) Fix bug with in page links called from parent page.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iframe-resizer",
"version": "3.5.8",
"version": "3.5.9",
"homepage": "https://github.com/davidjbradshaw/iframe-resizer",
"authors": [
"David J. Bradshaw <[email protected]>"
Expand Down
6 changes: 4 additions & 2 deletions js/iframeResizer.contentWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
;(function(window, undefined) {
'use strict';

if(typeof window === 'undefined') return;

var
autoResize = true,
base = 10,
Expand Down Expand Up @@ -1054,7 +1056,7 @@
}

function isMiddleTier(){
return ('iFrameResize' in window);
return !(typeof module !== 'undefined' && module.exports) && ('iFrameResize' in window);
}

function isInitMsg(){
Expand Down Expand Up @@ -1101,4 +1103,4 @@



})(window || {});
})(window);
2 changes: 1 addition & 1 deletion js/iframeResizer.contentWindow.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/iframeResizer.contentWindow.min.js

Large diffs are not rendered by default.

33 changes: 26 additions & 7 deletions js/iframeResizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
;(function(window) {
'use strict';

if(typeof window === 'undefined') return; // don't run for server side render

var
count = 0,
logEnabled = false,
Expand Down Expand Up @@ -48,6 +50,7 @@
scrolling : false,
sizeHeight : true,
sizeWidth : false,
warningTimeout : 5000,
tolerance : 0,
widthCalculationMethod : 'scroll',
closedCallback : function(){},
Expand Down Expand Up @@ -497,6 +500,8 @@
messageData = processMsg();
iframeId = logId = messageData.id;

clearTimeout(settings[iframeId].msgTimeout);

if (!isMessageFromMetaParent() && hasSettings(iframeId)){
log(iframeId,'Received: '+msg);

Expand Down Expand Up @@ -619,7 +624,7 @@
}
}

function trigger(calleeMsg,msg,iframe,id){
function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
function postMessageToIFrame(){
var target = settings[id].targetOrigin;
log(id,'[' + calleeMsg + '] Sending msg to iframe['+id+'] ('+msg+') targetOrigin: '+target);
Expand All @@ -638,10 +643,24 @@
}
}

function warnOnNoResponse() {

function warning() {
warn(id, 'No response from iFrame. Check iFrameResizer.contentWindow.js has been loaded in iFrame');
}

if (!!noResponseWarning) {
settings[id].msgTimeout = setTimeout(warning, settings[id].warningTimeout);

}
}


id = id || iframe.id;

if(settings[id]) {
chkAndSend();
warnOnNoResponse();
}

}
Expand Down Expand Up @@ -761,7 +780,7 @@

sendMessage : function(message){
message = JSON.stringify(message);
trigger('Send Message','message:'+message, settings[iframeId].iframe,iframeId);
trigger('Send Message','message:'+message, settings[iframeId].iframe, iframeId);
}
};
}
Expand All @@ -772,12 +791,12 @@
//event listener also catches the page changing in the iFrame.
function init(msg){
function iFrameLoaded(){
trigger('iFrame.onload',msg,iframe);
trigger('iFrame.onload', msg, iframe, undefined , true);
checkReset();
}

addEventListener(iframe,'load',iFrameLoaded);
trigger('init',msg,iframe);
trigger('init', msg, iframe, undefined, true);
}

function checkOptions(options){
Expand Down Expand Up @@ -852,7 +871,7 @@
}

if (isVisible(settings[settingId].iframe) && (chkDimension('height') || chkDimension('width'))){
trigger('Visibility change', 'resize', settings[settingId].iframe,settingId);
trigger('Visibility change', 'resize', settings[settingId].iframe, settingId);
}
}

Expand Down Expand Up @@ -920,7 +939,7 @@

for (var iframeId in settings){
if(isIFrameResizeEnabled(iframeId)){
trigger(eventName,event,document.getElementById(iframeId),iframeId);
trigger(eventName, event, document.getElementById(iframeId), iframeId);
}
}
}
Expand Down Expand Up @@ -1013,4 +1032,4 @@
window.iFrameResize = window.iFrameResize || factory();
}

})(window || {});
})(window);
2 changes: 1 addition & 1 deletion js/iframeResizer.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/iframeResizer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iframe-resizer",
"version": "3.5.8",
"version": "3.5.9",
"homepage": "https://github.com/davidjbradshaw/iframe-resizer",
"authors": [
"David J. Bradshaw <[email protected]>"
Expand Down

0 comments on commit be044b4

Please sign in to comment.