Skip to content

Commit

Permalink
Added beginning of drop-down menus on dataset tiles, plus modificatio…
Browse files Browse the repository at this point in the history
…ns to gene selector and dataset selector widgets so their dropdown customizations are specific to them
  • Loading branch information
jorvis committed Jan 21, 2024
1 parent ab2eef1 commit acef04c
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 25 deletions.
1 change: 0 additions & 1 deletion www/css/common.v2.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ html, body {
/* -= Typography =- */



/* -------------------- */
/* -= Header section =- */

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
div.dropdown-menu {
#dropdown-dc div.dropdown-menu {
width: 60vw;
}
@media (min-width: 1320px) {
div.dropdown-menu {
#dropdown-dc div.dropdown-menu {
width: 55vw;
}
}
@media (min-width: 1440px) {
div.dropdown-menu {
#dropdown-dc div.dropdown-menu {
width: 50vw;
}
}
@media (min-width: 1580px) {
div.dropdown-menu {
#dropdown-dc div.dropdown-menu {
width: 45vw;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

<div id="dropdown-dc" class="control dropdown is-right is-loading is-disabled mr-0">
<div class="dropdown-trigger is-clickable">
<button class="button">
<span id="dropdown-dc-selector-label">Choose a Dataset Collection</span>
<span class="icon is-small">
<i class="mdi mdi-chevron-down" aria-hidden="true"></i>
<button class="button dropdown-trigger">
<span id="dropdown-dc-selector-label" class="dropdown-trigger">Choose a Dataset Collection</span>
<span class="icon is-small dropdown-trigger">
<i class="mdi mdi-chevron-down dropdown-trigger" aria-hidden="true"></i>
</span>
</button>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
div.dropdown-menu {
#dropdown-gene-lists div.dropdown-menu {
width: 60vw;
}
@media (min-width: 1320px) {
div.dropdown-menu {
#dropdown-gene-lists div.dropdown-menu {
width: 55vw;
}
}
@media (min-width: 1440px) {
div.dropdown-menu {
#dropdown-gene-lists div.dropdown-menu {
width: 50vw;
}
}
@media (min-width: 1580px) {
div.dropdown-menu {
#dropdown-gene-lists div.dropdown-menu {
width: 45vw;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
<script src="include/gene-collection-selector/gene-collection-selector.js"></script>

<div id="dropdown-gene-lists" class="control dropdown is-right is-loading is-disabled mr-0">
<div class="dropdown-trigger is-clickable">
<button class="button">
<span id="dropdown-gene-list-selector-label">Quick search using Gene Lists</span>
<span class="icon is-small">
<i class="mdi mdi-chevron-down" aria-hidden="true"></i>
<div class="is-clickable">
<!-- why doesn't have dropdown-trigger on the button alone capture all clicks?? -->
<button class="button dropdown-trigger">
<span id="dropdown-gene-list-selector-label" class="dropdown-trigger">Quick search using Gene Lists</span>
<span class="icon is-small dropdown-trigger">
<i class="mdi mdi-chevron-down dropdown-trigger" aria-hidden="true"></i>
</span>
</button>
</div>
Expand Down
32 changes: 29 additions & 3 deletions www/include/tile-grid/tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,35 @@
<div class="card-header has-background-primary">
<div class="card-header-title py-0"></div>
<div class="card-header-icon">
<span class="icon">
<i class="mdi mdi-18px mdi-dots-vertical"></i>
</span>
<div class="dropdown is-right dataset-dropdown">
<div>
<button class="button dropdown-trigger" aria-haspopup="true" aria-controls="dropdown-menu">
<span class="icon">
<i class="mdi mdi-18px mdi-dots-vertical dropdown-trigger"></i>
</span>
</button>
</div>
<div class="dropdown-menu" id="dropdown-menu" role="menu">
<div class="dropdown-content">
<a href="#" class="dropdown-item">
Dropdown item
</a>
<a class="dropdown-item">
Other dropdown item
</a>
<a href="#" class="dropdown-item is-active">
Active dropdown item
</a>
<a href="#" class="dropdown-item">
Other dropdown item
</a>
<hr class="dropdown-divider">
<a href="#" class="dropdown-item">
With a divider
</a>
</div>
</div>
</div>
</div>
</div>
<div class="card-image"></div>
Expand Down
10 changes: 6 additions & 4 deletions www/js/common.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ document.addEventListener('DOMContentLoaded', () => {
});

// Bulma dropdowns can't be clicked without a wee bit of Javascript
document.querySelectorAll('.dropdown-trigger').forEach(item => {
item.addEventListener('click', (event) => {
document.addEventListener('click', (event) => {
let item = event.target;
if (item.classList.contains('dropdown-trigger')) {
console.log("dropdown-trigger clicked");
event.stopPropagation();
item.parentNode.classList.toggle('is-active');
});
item.closest(".dropdown").classList.toggle('is-active');
}
});


Expand Down

0 comments on commit acef04c

Please sign in to comment.