Skip to content
This repository was archived by the owner on May 8, 2018. It is now read-only.

Commit fc4e5d6

Browse files
author
Ruben Schmidmeister
committed
Merge branch 'enhancement/usability-update'
2 parents da58336 + 5d9de7e commit fc4e5d6

File tree

9 files changed

+969
-61
lines changed

9 files changed

+969
-61
lines changed

Application/js/bootstrap/info.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
console.log(`Hey there, nice to meet you!
1111
12-
If you're interested in checking out the full source code
13-
it's available at https://github.com/timetabio/code.
14-
15-
We're currently in beta, so if you need a login, sign up at https://beta.timetab.io
12+
If you're interested in checking out some of our source code
13+
it's available at https://github.com/timetabio.
1614
`)

Application/js/elements/user-menu.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99

1010
import { EventName } from '../dom/custom-events'
1111

12+
/**
13+
*
14+
* @param {Element} element
15+
* @param {string} attribute
16+
* @param {string} value
17+
*/
18+
function toggleAttribute (element, attribute, value = '') {
19+
if (element.hasAttribute(attribute)) {
20+
element.removeAttribute(attribute)
21+
} else {
22+
element.setAttribute(attribute, value)
23+
}
24+
}
25+
1226
export class UserMenu extends HTMLElement {
1327
constructor () {
1428
super()
@@ -29,6 +43,7 @@ export class UserMenu extends HTMLElement {
2943

3044
_onToggle () {
3145
this.classList.toggle('-open')
46+
toggleAttribute(this._$nav, 'inert')
3247
}
3348

3449
/**
@@ -43,4 +58,13 @@ export class UserMenu extends HTMLElement {
4358

4459
this.classList.remove('-open')
4560
}
61+
62+
/**
63+
*
64+
* @returns {Element}
65+
* @private
66+
*/
67+
get _$nav () {
68+
return this.querySelector('.nav')
69+
}
4670
}

0 commit comments

Comments
 (0)