'tabindex': -1
})
.focus();
- _this._addRevealOpenClasses();
+ _this._addGlobalClasses();
Keyboard.trapFocus(_this.$element);
}
if (this.options.overlay) {
.focus();
Keyboard.trapFocus(this.$element);
- this._addRevealOpenClasses();
+ this._addGlobalClasses();
- this._extraHandlers();
+ this._addGlobalListeners();
/**
* Fires when the modal has successfully opened.
this.$element.trigger('open.zf.reveal');
}
- _addRevealOpenClasses() {
+ _addGlobalClasses() {
const updateScrollbarClass = () => {
$('html').toggleClass('zf-has-scroll', !!($(document).height() > $(window).height()));
};
$('html').addClass('is-reveal-open');
}
- _removeRevealOpenClasses() {
+ _removeGlobalClasses() {
this.$element.off('resizeme.zf.trigger.revealScrollbarListener');
$('html').removeClass('is-reveal-open');
$('html').removeClass('zf-has-scroll');
* Adds extra event handlers for the body and window if necessary.
* @private
*/
- _extraHandlers() {
+ _addGlobalListeners() {
var _this = this;
if(!this.$element) { return; } // If we're in the middle of cleanup, don't freak out
this.focusableElements = Keyboard.findFocusable(this.$element);
var scrollTop = parseInt($("html").css("top"));
if ($('.reveal:visible').length === 0) {
- _this._removeRevealOpenClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
+ _this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
}
Keyboard.releaseFocus(_this.$element);
.off(this.onLoadListener);
if ($('.reveal:visible').length === 0) {
- this._removeRevealOpenClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
+ this._removeGlobalClasses(); // also remove .is-reveal-open from the html element when there is no opened reveal
}
};
}