diff options
author | 2016-09-19 17:32:42 +0800 | |
---|---|---|
committer | 2016-09-19 17:32:42 +0800 | |
commit | 0c4c35f8fd0e68e5f04f88639d6869526075e513 (patch) | |
tree | 5ee64b8e22ed8d103b59bd7555ddc2370eb946ec /openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js | |
parent | d72d6805ae03018254edb6608f9b193915495880 (diff) |
add thirdparty files
Change-Id: Ice7ebee337a78faf506691e80d4a9a83f4eb7f02
Signed-off-by: “shentao” <shentao@chinamobile.com>
Diffstat (limited to 'openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js')
-rw-r--r-- | openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js b/openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js new file mode 100644 index 00000000..fac00fdb --- /dev/null +++ b/openo-portal/portal-common/src/main/webapp/common/thirdparty/bootstrap-hover-dropdown/bootstrap-hover-dropdown.js @@ -0,0 +1,14 @@ +/** + * 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,n){var o=e();e.fn.dropdownHover=function(t){return"ontouchstart"in document?this:(o=o.add(this.parent()),this.each(function(){var i,r=e(this),s=r.parent(),d={delay:500,instantlyCloseOthers:!0},a={delay:e(this).data("delay"),instantlyCloseOthers:e(this).data("close-others")},h="show.bs.dropdown",u="hide.bs.dropdown",l=e.extend(!0,{},d,t,a);s.hover(function(e){return s.hasClass("open")||r.is(e.target)?(o.find(":focus").blur(),l.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),s.addClass("open"),void r.trigger(h)):!0},function(){i=n.setTimeout(function(){s.removeClass("open"),r.trigger(u)},l.delay)}),r.hover(function(){o.find(":focus").blur(),l.instantlyCloseOthers===!0&&o.removeClass("open"),n.clearTimeout(i),s.addClass("open"),r.trigger(h)}),s.find(".dropdown-submenu").each(function(){var o,t=e(this);t.hover(function(){n.clearTimeout(o),t.children(".dropdown-menu").show(),t.siblings().children(".dropdown-menu").hide()},function(){var e=t.children(".dropdown-menu");o=n.setTimeout(function(){e.hide()},l.delay)})})}))},e(document).ready(function(){e('[data-hover="dropdown"]').not(".hover-initialized").each(function(){e(this).dropdownHover(),e(this).addClass("hover-initialized")})})}(jQuery,this); |