vendor/assets/js/foundation.js in foundation-rails-6.5.1.0 vs vendor/assets/js/foundation.js in foundation-rails-6.5.3.0
- old
+ new
@@ -1850,12 +1850,19 @@
}, {
key: "down",
value: function down($target) {
var _this2 = this;
+ // If having multiple submenus active is disabled, close all the submenus
+ // that are not parents or children of the targeted submenu.
if (!this.options.multiOpen) {
- this.up(this.$element.find('.is-active').not($target.parentsUntil(this.$element).add($target)));
+ // The "branch" of the targetted submenu, from the component root to
+ // the active submenus nested in it.
+ var $targetBranch = $target.parentsUntil(this.$element).add($target).add($target.find('.is-active')); // All the active submenus that are not in the branch.
+
+ var $othersActiveSubmenus = this.$element.find('.is-active').not($targetBranch);
+ this.up($othersActiveSubmenus);
}
$target.addClass('is-active').attr({
'aria-hidden': false
});
@@ -1994,11 +2001,11 @@
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
-var FOUNDATION_VERSION = '6.5.1'; // Global Foundation object
+var FOUNDATION_VERSION = '6.5.3'; // Global Foundation object
// This is attached to the window, or used as a module for AMD/Browserify
var Foundation = {
version: FOUNDATION_VERSION,
@@ -3398,10 +3405,11 @@
/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
/* harmony import */ var _foundation_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.core.utils */ "./js/foundation.core.utils.js");
/* harmony import */ var _foundation_positionable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.positionable */ "./js/foundation.positionable.js");
/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
+/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -3427,10 +3435,11 @@
+
/**
* Dropdown module.
* @module foundation.dropdown
* @requires foundation.util.keyboard
* @requires foundation.util.box
@@ -7886,10 +7895,11 @@
/* harmony import */ var _foundation_util_keyboard__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./foundation.util.keyboard */ "./js/foundation.util.keyboard.js");
/* harmony import */ var _foundation_util_mediaQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./foundation.util.mediaQuery */ "./js/foundation.util.mediaQuery.js");
/* harmony import */ var _foundation_util_motion__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./foundation.util.motion */ "./js/foundation.util.motion.js");
/* harmony import */ var _foundation_core_plugin__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./foundation.core.plugin */ "./js/foundation.core.plugin.js");
/* harmony import */ var _foundation_util_triggers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./foundation.util.triggers */ "./js/foundation.util.triggers.js");
+/* harmony import */ var _foundation_util_touch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./foundation.util.touch */ "./js/foundation.util.touch.js");
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -7913,10 +7923,11 @@
+
/**
* Reveal module.
* @module foundation.reveal
* @requires foundation.util.keyboard
* @requires foundation.util.triggers
@@ -9577,12 +9588,13 @@
*/
}, {
key: "_events",
value: function _events() {
- this.$element.on('click.zf.smoothScroll', this._handleLinkClick);
- this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._handleLinkClick);
+ this._linkClickListener = this._handleLinkClick.bind(this);
+ this.$element.on('click.zf.smoothScroll', this._linkClickListener);
+ this.$element.on('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
}
/**
* Handle the given event to smoothly scroll to the anchor pointed by the event target.
* @param {*} e - event
* @function
@@ -9609,12 +9621,12 @@
/**
* Destroys the SmoothScroll instance.
* @function
*/
value: function _destroy() {
- this.$element.off('click.zf.smoothScroll', this._handleLinkClick);
- this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._handleLinkClick);
+ this.$element.off('click.zf.smoothScroll', this._linkClickListener);
+ this.$element.off('click.zf.smoothScroll', 'a[href^="#"]', this._linkClickListener);
}
}], [{
key: "scrollToLoc",
/**
@@ -12569,13 +12581,10 @@
var $item = jquery__WEBPACK_IMPORTED_MODULE_0___default()(this),
$sub = $item.children('ul');
if ($sub.length) {
$item.addClass(hasSubClass);
- $sub.addClass("submenu ".concat(subMenuClass)).attr({
- 'data-submenu': ''
- });
if (applyAria) {
$item.attr({
'aria-haspopup': true,
'aria-label': $item.children('a:first').text()
@@ -13050,10 +13059,10 @@
if (pluginName) {
if (typeof pluginName === 'string') {
plugNames.push(pluginName);
} else if (_typeof(pluginName) === 'object' && typeof pluginName[0] === 'string') {
- plugNames.concat(pluginName);
+ plugNames = plugNames.concat(pluginName);
} else {
console.error('Plugin names must be strings');
}
}
\ No newline at end of file