mirror of
https://github.com/picocss/pico.git
synced 2025-04-20 16:46:14 -04:00
Revert "Feature: modal"
This commit is contained in:
parent
39314102d2
commit
d5544ea021
115 changed files with 3754 additions and 6410 deletions
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* Toggle navigation
|
||||
*
|
||||
* Pico.css - https://picocss.com
|
||||
* Copyright 2019-2021 - Licensed under MIT
|
||||
*/
|
||||
|
||||
export const toggleNavigation = {
|
||||
|
||||
// Config
|
||||
_state: 'closed-on-mobile',
|
||||
toggleLink: document.getElementById('toggle-docs-navigation'),
|
||||
nav: document.querySelector('main > aside > nav'),
|
||||
|
||||
// Init
|
||||
init() {
|
||||
this.onToggleClick()
|
||||
},
|
||||
|
||||
onToggleClick() {
|
||||
this.toggleLink.addEventListener('click', event => {
|
||||
event.preventDefault();
|
||||
this.state == 'closed-on-mobile'
|
||||
? this.state = 'open'
|
||||
: this.state = 'closed-on-mobile';
|
||||
this.nav.removeAttribute('class');
|
||||
this.nav.classList.add(this.state);
|
||||
}, false);
|
||||
},
|
||||
|
||||
// Get state
|
||||
get state() {
|
||||
return this._state;
|
||||
},
|
||||
|
||||
// Set state
|
||||
set state(state) {
|
||||
this._state = state;
|
||||
},
|
||||
};
|
||||
|
||||
export default toggleNavigation;
|
Loading…
Add table
Add a link
Reference in a new issue