Skip to content

Commit

Permalink
resize event
Browse files Browse the repository at this point in the history
  • Loading branch information
turtledreams committed Dec 23, 2024
1 parent ca05bc0 commit 8411764
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var healthCheckCounterEnum = Object.freeze({
errorMessage: "cly_hc_error_message",
});

var SDK_VERSION = "24.11.0";
var SDK_VERSION = "24.11.2";
var SDK_NAME = "javascript_native_web";

// Using this on document.referrer would return an array with 17 elements in it. The 12th element (array[11]) would be the path we are looking for. Others would be things like password and such (use https://regex101.com/ to check more)
Expand Down
15 changes: 15 additions & 0 deletions modules/CountlyClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -3724,6 +3724,21 @@ constructor(ob) {
window.addEventListener('message', (event) => {
this.#interpretContentMessage(event);
});
let resizeTimeout;
window.addEventListener('resize', () => {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(() => {
const width = window.innerWidth;
const height = window.innerHeight;
const iframe = document.getElementById(this.#contentIframeID);
iframe.contentWindow.postMessage(
{ type: 'resize', width: width, height: height },
'*'
);
}, 200);
});


}, true);
};

Expand Down

0 comments on commit 8411764

Please sign in to comment.