diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index f24baf5810..c59a7fd974 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -2763,7 +2763,7 @@ table .span24 { .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; - margin-top: -5px; + margin-top: -6px; margin-left: -1px; -webkit-border-radius: 0 6px 6px 6px; -moz-border-radius: 0 6px 6px 6px; @@ -2774,6 +2774,24 @@ table .span24 { display: block; } +.dropdown-submenu > a:after { + display: block; + float: right; + width: 0; + height: 0; + margin-top: 5px; + margin-right: -10px; + border-color: transparent; + border-left-color: #cccccc; + border-style: solid; + border-width: 5px 0 5px 5px; + content: " "; +} + +.dropdown-submenu:hover > a:after { + border-left-color: #ffffff; +} + .dropdown .dropdown-menu .nav-header { padding-right: 20px; padding-left: 20px; diff --git a/docs/components.html b/docs/components.html index c36eec9403..719a9e8743 100644 --- a/docs/components.html +++ b/docs/components.html @@ -122,16 +122,7 @@
...
+Align menus to the right and add include additional levels of dropdowns.
...
+Add .pull-right
to a .dropdown-menu
to right align the dropdown menu.
+<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel"> + ... +</ul> ++ +
Add an extra level of dropdown menus, appearing on hover like those of OS X, with some simple markup additions. Add .dropdown-submenu
to any li
in an existing dropdown menu for automatic styling.
+<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> + ... + <li class="dropdown-submenu"> + <a tabindex="-1" href="#">More options</a> + <ul class="dropdown-menu"> + ... + </ul> + </li> +</ul> ++ diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache index e9022ee125..7ac31e2191 100644 --- a/docs/templates/pages/components.mustache +++ b/docs/templates/pages/components.mustache @@ -51,16 +51,7 @@
{{_i}}...{{/i}}
+{{_i}}Align menus to the right and add include additional levels of dropdowns.{{/i}}
{{_i}}...{{/i}}
+{{_i}}Add .pull-right
to a .dropdown-menu
to right align the dropdown menu.{{/i}}
+<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dLabel"> + ... +</ul> ++ +
{{_i}}Add an extra level of dropdown menus, appearing on hover like those of OS X, with some simple markup additions. Add .dropdown-submenu
to any li
in an existing dropdown menu for automatic styling.{{/i}}
+<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> + ... + <li class="dropdown-submenu"> + <a tabindex="-1" href="#">{{_i}}More options{{/i}}</a> + <ul class="dropdown-menu"> + ... + </ul> + </li> +</ul> ++ diff --git a/less/dropdowns.less b/less/dropdowns.less index a36c3a416f..fb85ca57af 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -176,7 +176,7 @@ .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; - margin-top: -5px; + margin-top: -6px; margin-left: -1px; -webkit-border-radius: 0 6px 6px 6px; -moz-border-radius: 0 6px 6px 6px; @@ -186,6 +186,23 @@ display: block; } +.dropdown-submenu > a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: darken(@dropdownBackground, 20%); + margin-top: 5px; + margin-right: -10px; +} +.dropdown-submenu:hover > a:after { + border-left-color: @dropdownLinkColorHover; +} + // Tweak nav headers // -----------------