diff options
Diffstat (limited to 'openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js')
-rw-r--r-- | openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js b/openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js new file mode 100644 index 00000000..0bf4687b --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js @@ -0,0 +1,13 @@ +/** + * 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(b,a,c){var d=b();b.fn.dropdownHover=function(e){if("ontouchstart" in document){return this}d=d.add(this.parent());return this.each(function(){var m=b(this),l=m.parent(),k={delay:500,instantlyCloseOthers:true},i={delay:b(this).data("delay"),instantlyCloseOthers:b(this).data("close-others")},f="show.bs.dropdown",j="hide.bs.dropdown",g=b.extend(true,{},k,e,i),h;l.hover(function(n){if(!l.hasClass("open")&&!m.is(n.target)){return true}d.find(":focus").blur();if(g.instantlyCloseOthers===true){d.removeClass("open")}a.clearTimeout(h);l.addClass("open");m.trigger(f)},function(){h=a.setTimeout(function(){l.removeClass("open");m.trigger(j)},g.delay)});m.hover(function(){d.find(":focus").blur();if(g.instantlyCloseOthers===true){d.removeClass("open")}a.clearTimeout(h);l.addClass("open");m.trigger(f)});l.find(".dropdown-submenu").each(function(){var o=b(this);var n;o.hover(function(){a.clearTimeout(n);o.children(".dropdown-menu").show();o.siblings().children(".dropdown-menu").hide()},function(){var p=o.children(".dropdown-menu");n=a.setTimeout(function(){p.hide()},g.delay)})})})};b(document).ready(function(){b('[data-hover="dropdown"]').dropdownHover()})})(jQuery,this);
\ No newline at end of file |