Merge pull request #1985 from jasongrout/checkresize

Ignore resize events that bubbled up and didn't come from window.
This commit is contained in:
Min RK 2016-12-19 15:35:14 +01:00 committed by GitHub
commit fb8f730c6e

View File

@ -52,9 +52,19 @@ define([
this._resize_site();
};
Page.prototype._resize_site = function() {
// Update the site's size.
$('div#site').height($(window).height() - $('#header').height());
Page.prototype._resize_site = function(e) {
/**
* Update the site's size.
*/
// In the case an event is passed in, only trigger if the event does
// *not* have a target DOM node (i.e., it is not bubbling up). See
// https://bugs.jquery.com/ticket/9841#comment:8
if (!(e && e.target && e.target.tagName)) {
$('div#site').height($(window).height() - $('#header').height());
}
};
return {'Page': Page};