Skip to content

Commit

Permalink
Merge pull request #1972 from kayla-glick/fix-import-export-dropdown
Browse files Browse the repository at this point in the history
change dropdown menu offset to prevent closing on hover
  • Loading branch information
kayla-glick authored Nov 29, 2022
2 parents 5ef5341 + 0168f6f commit 0a474ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ui/core/components/sim_title_dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class SimTitleDropdown extends Component {

let fragment = document.createElement('fragment');
fragment.innerHTML = `
<a href="javascript:void(0)" class="sim-link ${textKlass}" role="button" data-bs-toggle="dropdown" data-bs-offset="0,0" aria-expanded="false">
<a href="javascript:void(0)" class="sim-link ${textKlass}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<div class="sim-link-content">
<img src="${iconPath}" class="sim-link-icon">
<div class="d-flex flex-column">
Expand Down Expand Up @@ -195,7 +195,7 @@ export class SimTitleDropdown extends Component {

let fragment = document.createElement('fragment');
fragment.innerHTML = `
<a href="${href}" class="sim-link ${textKlass}" ${specIndexes.length > 1 ? 'role="button" data-bs-toggle="dropdown" data-bs-offset="0,0" aria-expanded="false"' : ''}>
<a href="${href}" class="sim-link ${textKlass}" ${specIndexes.length > 1 ? 'role="button" data-bs-toggle="dropdown" aria-expanded="false"' : ''}>
<div class="sim-link-content">
<img src="${iconPath}" class="sim-link-icon">
<div class="d-flex flex-column">
Expand Down
10 changes: 5 additions & 5 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2 class="wrath-title w-100 order-1 order-md-2">Wrath of the Lich King</h2>

<div class="sim-links">
<div class="dropend sim-link-dropdown">
<a href="javascript:void(0)" class="sim-link text-warrior" role="button" data-bs-toggle="dropdown" data-bs-offset="0,0" aria-expanded="false">
<a href="javascript:void(0)" class="sim-link text-warrior" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<div class="sim-link-content">
<img src="/wotlk/assets/img/warrior_icon.png" class="sim-link-icon">
<span class="sim-link-label">Warrior</span>
Expand Down Expand Up @@ -96,7 +96,7 @@ <h2 class="wrath-title w-100 order-1 order-md-2">Wrath of the Lich King</h2>
</ul>
</div>
<div class="dropend sim-link-dropdown">
<a href="javascript:void(0)" class="sim-link text-paladin" role="button" data-bs-toggle="dropdown" data-bs-offset="0,0" aria-expanded="false">
<a href="javascript:void(0)" class="sim-link text-paladin" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<div class="sim-link-content">
<img src="/wotlk/assets/img/paladin_icon.png" class="sim-link-icon">
<span class="sim-link-label">Paladin</span>
Expand Down Expand Up @@ -140,7 +140,7 @@ <h2 class="wrath-title w-100 order-1 order-md-2">Wrath of the Lich King</h2>
</div>
</a>
<div class="dropend sim-link-dropdown">
<a href="javascript:void(0)" class="sim-link text-priest" role="button" data-bs-toggle="dropdown" data-bs-offset="0,0" aria-expanded="false">
<a href="javascript:void(0)" class="sim-link text-priest" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<div class="sim-link-content">
<img src="/wotlk/assets/img/priest_icon.png" class="sim-link-icon">
<span class="sim-link-label">Priest</span>
Expand Down Expand Up @@ -180,7 +180,7 @@ <h2 class="wrath-title w-100 order-1 order-md-2">Wrath of the Lich King</h2>
</a>

<div class="dropend sim-link-dropdown">
<a href="javascript:void(0)" class="sim-link text-shaman" role="button" data-bs-toggle="dropdown" data-bs-offset="0,0" aria-expanded="false">
<a href="javascript:void(0)" class="sim-link text-shaman" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<div class="sim-link-content">
<img src="/wotlk/assets/img/shaman_icon.png" class="sim-link-icon">
<span class="sim-link-label">Shaman</span>
Expand Down Expand Up @@ -227,7 +227,7 @@ <h2 class="wrath-title w-100 order-1 order-md-2">Wrath of the Lich King</h2>
</a>

<div class="dropend sim-link-dropdown">
<a href="javascript:void(0)" class="sim-link text-druid" role="button" data-bs-toggle="dropdown" data-bs-offset="0,0" aria-expanded="false">
<a href="javascript:void(0)" class="sim-link text-druid" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<div class="sim-link-content">
<img src="/wotlk/assets/img/druid_icon.png" class="sim-link-icon">
<div>
Expand Down
1 change: 0 additions & 1 deletion ui/scss/core/sim_ui/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ td, th {
text-align: right;
min-width: auto;
font-weight: bold;
top: 120%;
}
.sim-dropdown-menu .dropdown-item {
display: block;
Expand Down
2 changes: 2 additions & 0 deletions ui/shared/bootstrap_overrides.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as bootstrap from 'bootstrap';
import { isDescendant } from './utils';

bootstrap.Dropdown.Default.offset = [0,0];

let body = document.querySelector('body') as HTMLElement;

// Custom dropdown event handlers for mouseover dropdowns
Expand Down

0 comments on commit 0a474ae

Please sign in to comment.