}
}
+ /**
+ * Stops scrolling of the body when offcanvas is open on mobile Safari and other troublesome browsers.
+ * @private
+ */
+ _stopScrolling(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ return false;
+ }
+
/**
* Opens the off-canvas menu.
* @function
// If we have an overlay lets make it visible.
if (this.options.contentOverlay) {
+ $('body').on('touchmove', this._stopScrolling);
this.$overlay.addClass('is-visible');
}
// Remove `is-visible` class from overlay.
if (this.options.contentOverlay) {
+ $('body').off('touchmove', this._stopScrolling);
this.$overlay.removeClass('is-visible');
}