mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* WIP js upgrades * trying 3.0 * Event handler changes * fix alert rule collection loading * blur fix * jQuery 3.5 homescreen no warnings * actually 3.6 include js * Update bootstrap to 3.4.1 * missed file * Update and test install process * cleanup * attempt to version js files that were updated.
14 lines
1.5 KiB
JavaScript
14 lines
1.5 KiB
JavaScript
/**
|
|
* Project: Bootstrap Hover Dropdown
|
|
* Author: Cameron Spear
|
|
* Contributors: Mattia Larentis
|
|
*
|
|
* Dependencies: Bootstrap's Dropdown plugin, jQuery
|
|
*
|
|
* A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
|
|
*
|
|
* License: MIT
|
|
*
|
|
* http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/
|
|
*/(function(e,t,n){var r=e();e.fn.dropdownHover=function(n){if("ontouchstart"in document)return this;r=r.add(this.parent());return this.each(function(){var i=e(this),s=i.parent(),o={delay:500,instantlyCloseOthers:!0},u={delay:e(this).data("delay"),instantlyCloseOthers:e(this).data("close-others")},a="show.bs.dropdown",f="hide.bs.dropdown",l=e.extend(!0,{},o,n,u),c;s.on("mouseenter",function(e){if(!s.hasClass("open")&&!i.is(e.target))return!0;l.instantlyCloseOthers===!0&&r.removeClass("open");t.clearTimeout(c);s.addClass("open");i.trigger(a)}).on("mouseleave",function(){c=t.setTimeout(function(){s.removeClass("open");i.trigger(f)},l.delay)});i.on("mouseenter",function(){l.instantlyCloseOthers===!0&&r.removeClass("open");t.clearTimeout(c);s.addClass("open");i.trigger(a)});s.find(".dropdown-submenu").each(function(){var n=e(this),r;n.on("mouseenter",function(){t.clearTimeout(r);n.children(".dropdown-menu").show();n.siblings().children(".dropdown-menu").hide()}).on("mouseleave",function(){var e=n.children(".dropdown-menu");r=t.setTimeout(function(){e.hide()},l.delay)})})})};e(document).ready(function(){e('[data-hover="dropdown"]').dropdownHover()})})(jQuery,this);
|