Skip to content

Commit 4d7a644

Browse files
committed
ignore resize events when element (e.g. video) enters/exits fullscreen
1 parent 53f9dfa commit 4d7a644

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

dist/packery.pkgd.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3125,6 +3125,14 @@ proto.resize = function() {
31253125
* @returns Boolean
31263126
*/
31273127
proto.needsResizeLayout = function() {
3128+
if (this.isFullscreen()) {
3129+
this.fullscreen = true;
3130+
return false;
3131+
} else if (this.fullscreen) {
3132+
this.fullscreen = false;
3133+
return false;
3134+
}
3135+
31283136
var size = getSize( this.element );
31293137
var innerSize = this._getOption('horizontal') ? 'innerHeight' : 'innerWidth';
31303138
return size[ innerSize ] != this.size[ innerSize ];
@@ -3162,6 +3170,13 @@ proto.resizeShiftPercentLayout = function() {
31623170
this.shiftLayout();
31633171
};
31643172

3173+
proto.isFullscreen = function() {
3174+
return !!document.fullscreenElement ||
3175+
!!document.webkitFullscreenElement ||
3176+
!!document.mozFullScreenElement ||
3177+
!!document.msFullscreenElement;
3178+
};
3179+
31653180
// -------------------------- drag -------------------------- //
31663181

31673182
/**

0 commit comments

Comments
 (0)