From deda9dc3a7c98e58120b0cdd9c295ccf6a29d082 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Mon, 18 Jun 2018 23:27:39 +0200 Subject: [PATCH] refactor: rename Reveal internal methods for a better clarity --- js/foundation.reveal.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/foundation.reveal.js b/js/foundation.reveal.js index caf222c71..0c6dcf98b 100644 --- a/js/foundation.reveal.js +++ b/js/foundation.reveal.js @@ -283,7 +283,7 @@ class Reveal extends Plugin { 'tabindex': -1 }) .focus(); - _this._addRevealOpenClasses(); + _this._addGlobalClasses(); Keyboard.trapFocus(_this.$element); } if (this.options.overlay) { @@ -313,9 +313,9 @@ class Reveal extends Plugin { .focus(); Keyboard.trapFocus(this.$element); - this._addRevealOpenClasses(); + this._addGlobalClasses(); - this._extraHandlers(); + this._addGlobalListeners(); /** * Fires when the modal has successfully opened. @@ -324,7 +324,7 @@ class Reveal extends Plugin { this.$element.trigger('open.zf.reveal'); } - _addRevealOpenClasses() { + _addGlobalClasses() { const updateScrollbarClass = () => { $('html').toggleClass('zf-has-scroll', !!($(document).height() > $(window).height())); }; @@ -334,7 +334,7 @@ class Reveal extends Plugin { $('html').addClass('is-reveal-open'); } - _removeRevealOpenClasses() { + _removeGlobalClasses() { this.$element.off('resizeme.zf.trigger.revealScrollbarListener'); $('html').removeClass('is-reveal-open'); $('html').removeClass('zf-has-scroll'); @@ -344,7 +344,7 @@ class Reveal extends Plugin { * 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); @@ -421,7 +421,7 @@ class Reveal extends Plugin { 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); @@ -492,7 +492,7 @@ class Reveal extends Plugin { .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 } }; } -- 2.47.2