vendor/assets/js/foundation.dropdown.js in foundation-rails-6.1.1.3 vs vendor/assets/js/foundation.dropdown.js in foundation-rails-6.1.2.0

- old
+ new

@@ -1,17 +1,19 @@ /** * Dropdown module. * @module foundation.dropdown * @requires foundation.util.keyboard * @requires foundation.util.box + * @requires foundation.util.triggers */ !function($, Foundation){ 'use strict'; /** * Creates a new instance of a dropdown. * @class - * @param {jQuery} element - jQuery object to make into an accordion menu. + * @param {jQuery} element - jQuery object to make into a dropdown. + * Object should be of the dropdown panel, rather than its anchor. * @param {Object} options - Overrides to the default plugin settings. */ function Dropdown(element, options){ this.$element = element; this.options = $.extend({}, Dropdown.defaults, this.$element.data(), options); @@ -77,11 +79,11 @@ */ autoFocus: false, /** * Allows a click on the body to close the dropdown. * @option - * @example true + * @example false */ closeOnClick: false }; /** * Initializes the plugin by setting/checking options and attributes, adding helper variables, and saving the anchor. @@ -116,10 +118,10 @@ * Helper function to determine current orientation of dropdown pane. * @function * @returns {String} position - string value of a position class. */ Dropdown.prototype.getPositionClass = function(){ - var position = this.$element[0].className.match(/(top|left|right)/g); + var position = this.$element[0].className.match(/\b(top|left|right)\b/g); position = position ? position[0] : ''; return position; }; /** * Adjusts the dropdown panes orientation by adding/removing positioning classes.