* @example false
*/
hover: false,
+ /**
+ * Don't close dropdown when hovering over dropdown pane
+ * @option
+ * @example true
+ */
+ hoverPane: false,
/**
* Number of pixels between the dropdown pane and the triggering element on open.
* @option
this.$anchor.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')
.on('mouseenter.zf.dropdown', function(){
clearTimeout(_this.timeout);
- _this.timeOut = setTimeout(function(){
+ _this.timeout = setTimeout(function(){
_this.open();
_this.$anchor.data('hover', true);
}, _this.options.hoverDelay);
}).on('mouseleave.zf.dropdown', function(){
clearTimeout(_this.timeout);
- _this.timeOut = setTimeout(function(){
+ _this.timeout = setTimeout(function(){
_this.close();
_this.$anchor.data('hover', false);
}, _this.options.hoverDelay);
});
+ if(this.options.hoverPane){
+ this.$element.off('mouseenter.zf.dropdown mouseleave.zf.dropdown')
+ .on('mouseenter.zf.dropdown', function(){
+ clearTimeout(_this.timeout);
+ }).on('mouseleave.zf.dropdown', function(){
+ clearTimeout(_this.timeout);
+ _this.timeout = setTimeout(function(){
+ _this.close();
+ _this.$anchor.data('hover', false);
+ }, _this.options.hoverDelay);
+ });
+ }
}
this.$anchor.add(this.$element).on('keydown.zf.dropdown', function(e) {
this._setPosition();
this.$element.addClass('is-open')
.attr({'aria-hidden': false});
-
+
if(this.options.autoFocus){
var $focusable = Foundation.Keyboard.findFocusable(this.$element);
if($focusable.length){