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

Commit

Permalink
Merge branch 'enhancement/usability-update'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Schmidmeister committed Jan 14, 2017
2 parents da58336 + 5d9de7e commit fc4e5d6
Show file tree
Hide file tree
Showing 9 changed files with 969 additions and 61 deletions.
6 changes: 2 additions & 4 deletions Application/js/bootstrap/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

console.log(`Hey there, nice to meet you!
If you're interested in checking out the full source code
it's available at https://github.com/timetabio/code.
We're currently in beta, so if you need a login, sign up at https://beta.timetab.io
If you're interested in checking out some of our source code
it's available at https://github.com/timetabio.
`)
24 changes: 24 additions & 0 deletions Application/js/elements/user-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@

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

/**
*
* @param {Element} element
* @param {string} attribute
* @param {string} value
*/
function toggleAttribute (element, attribute, value = '') {
if (element.hasAttribute(attribute)) {
element.removeAttribute(attribute)
} else {
element.setAttribute(attribute, value)
}
}

export class UserMenu extends HTMLElement {
constructor () {
super()
Expand All @@ -29,6 +43,7 @@ export class UserMenu extends HTMLElement {

_onToggle () {
this.classList.toggle('-open')
toggleAttribute(this._$nav, 'inert')
}

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

this.classList.remove('-open')
}

/**
*
* @returns {Element}
* @private
*/
get _$nav () {
return this.querySelector('.nav')
}
}
Loading

0 comments on commit fc4e5d6

Please sign in to comment.