From 594cf65aa21f13e8e6e269673484dd55a0928d17 Mon Sep 17 00:00:00 2001 From: Nicolas Coden Date: Wed, 17 Jan 2018 18:14:27 +0100 Subject: [PATCH] fix: fix off-canvas option `revealOn` when used without classes #10867 Closes: https://github.com/zurb/foundation-sites/issues/10867 --- js/foundation.offcanvas.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/foundation.offcanvas.js b/js/foundation.offcanvas.js index 9fbb0bc03..5614084fb 100644 --- a/js/foundation.offcanvas.js +++ b/js/foundation.offcanvas.js @@ -120,8 +120,11 @@ class OffCanvas extends Plugin { this.options.isRevealed = this.options.isRevealed || new RegExp(this.options.revealClass, 'g').test(this.$element[0].className); + // Get the revealOn option from the class / ensure the `reveal-on-*` class is set. if (this.options.isRevealed === true) { + if (this.options.revealOn) this.options.revealOn = this.options.revealOn || this.$element[0].className.match(/(reveal-for-medium|reveal-for-large)/g)[0].split('-')[2]; + this.$element.first().addClass(`reveal-for-${this.options.revealOn}`); this._setMQChecker(); } -- 2.47.2