未验证 提交 96f2bd8e 编写于 作者: C catouse

* optimize submenu in dropdown with js.

上级 cf0b48f0
+function($) {
$(document).on('mouseenter.zui.dropdown', '.dropdown-submenu', function() {
var $menu = $(this).children('.dropdown-menu');
var isDropUp = $menu.closest('.dropup ').length;
$menu.css(isDropUp ? 'bottom' : 'top', 0);
($.zui.asap || setTimout)(function() {
var bouding = $menu[0].getBoundingClientRect();
if(isDropUp) {
$menu.css('bottom', bouding.top < 0 ? bouding.top : 0);
} else {
var bottomSpace = $(window).height() - bouding.bottom;
$menu.css('top', bottomSpace < 0 ? bottomSpace : 0);
}
}, 0);
});
}(window.jQuery);
...@@ -937,7 +937,7 @@ ...@@ -937,7 +937,7 @@
"name": "下拉菜单", "name": "下拉菜单",
"src": { "src": {
"less": ["~/modules/dropdowns.less"], "less": ["~/modules/dropdowns.less"],
"js": ["src/js/dropdown.js"] "js": ["src/js/dropdown.js", "src/js/dropdown.submenu.js"]
}, },
"ver": "1.0.0", "ver": "1.0.0",
"source": "Bootstrap", "source": "Bootstrap",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册