Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change dropdown menu offset to prevent closing on hover #1972

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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