mirror of
https://github.com/bigchaindb/site.git
synced 2024-11-22 01:36:55 +01:00
make dropdowns open on click by default, hover modifier
This commit is contained in:
parent
7ee013a8fe
commit
39cd8e703b
@ -2,8 +2,8 @@
|
||||
//=include bootstrap/js/dist/util.js
|
||||
//=include bootstrap/js/dist/dropdown.js
|
||||
|
||||
$('body').on('mouseenter mouseleave', '.dropdown', function(e) {
|
||||
var _d = $(e.target).closest('.dropdown')
|
||||
$('body').on('mouseenter mouseleave', '.dropdown--hover', function(e) {
|
||||
var _d = $(e.target).closest('.dropdown--hover')
|
||||
|
||||
_d.addClass('show')
|
||||
|
||||
|
@ -84,12 +84,12 @@
|
||||
}
|
||||
|
||||
.dropdown-menu.show,
|
||||
.dropdown:hover > .dropdown-menu {
|
||||
.dropdown--hover:hover > .dropdown-menu {
|
||||
transform: scale(1, 1);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.dropdown > .dropdown-toggle:active {
|
||||
.dropdown--hover > .dropdown-toggle:active {
|
||||
// Without this, clicking will make it sticky
|
||||
pointer-events: none;
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ Logo can be used with a base class and modifier classes for size & color:
|
||||
|
||||
<div class="dropdown">
|
||||
<a class="dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Hover me
|
||||
Click me
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
@ -335,3 +335,28 @@ Logo can be used with a base class and modifier classes for size & color:
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
<div class="dropdown dropdown--hover">
|
||||
<a class="dropdown-toggle" type="button" id="dropdownMenuButton2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Hover me
|
||||
</a>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton2">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
```html
|
||||
<div class="dropdown dropdown--hover">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Dropdown button
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton2">
|
||||
<a class="dropdown-item" href="#">Action</a>
|
||||
<a class="dropdown-item" href="#">Another action</a>
|
||||
<a class="dropdown-item" href="#">Something else here</a>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user