});
this._triggerElement.click($.proxy(this.toggle, this));
+
+ var timer = null;
+ this._triggerElement.hover(
+ (function() {
+ if (this._dropdown === null || !this._dropdown.isOpen()) {
+ timer = window.setTimeout((function() {
+ this.toggle(undefined, true);
+ }).bind(this), 300);
+ }
+ }).bind(this),
+ function() {
+ window.clearTimeout(timer);
+ timer = null;
+ }
+ );
+
if (this._options.showAllLink) {
this._triggerElement.dblclick($.proxy(this._dblClick, this));
}
/**
* Toggles the interactive dropdown.
*
- * @param {Event=} event
+ * @param {Event?} event
+ * @param {boolean?} openOnly
* @return {boolean}
*/
- toggle: function(event) {
+ toggle: function(event, openOnly) {
if (event instanceof Event) {
event.preventDefault();
}
this._dropdown = this._initDropdown();
}
+ if (openOnly === true && this._dropdown.isOpen()) {
+ return false;
+ }
+
if (this._dropdown.toggle()) {
if (!this._loadData) {
// check if there are outstanding items but there are no outstanding ones in the current list
this._container.removeClass('open');
},
+ /**
+ * Returns true if dropdown instance is visible.
+ *
+ * @returns {boolean}
+ */
+ isOpen: function() {
+ return this._triggerElement.hasClass('open');
+ },
+
/**
* Toggles the dropdown state, returns true if dropdown is open afterwards, else false.
*