Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit e9579ac

Browse files
committed
making sure the resize event fires after css transition
1 parent 33d6e87 commit e9579ac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

public/styleguide/js/styleguide.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@
261261
saveSize(theSize); //Save current viewport to cookie
262262
}
263263

264+
$("#sg-gen-container").on('transitionend webkitTransitionEnd', function(e){
265+
var targetOrigin = (window.location.protocol === "file:") ? "*" : window.location.protocol+"//"+window.location.host;
266+
document.getElementById('sg-viewport').contentWindow.postMessage({ "resize": "true" },targetOrigin);
267+
});
268+
264269
function saveSize(size) {
265270
if (!DataSaver.findValue('vpWidth')) {
266271
DataSaver.addValue("vpWidth",size);

0 commit comments

Comments
 (0)