renamed toggle function in vertical icon panel

pull/1/head
LianaHus 6 years ago
parent a8c150ee89
commit 2f230ccb40
  1. 16
      src/app/components/vertical-icons.js

@ -78,7 +78,7 @@ export class VerticalIcons {
this.icons[name] = yo`
<div
class="${css.icon}"
onclick="${() => { this._iconClick(name) }}"
onclick="${() => { this.toggle(name) }}"
plugin="${name}"
title="${title}">
<img class="image" src="${icon}" alt="${name}" />
@ -200,6 +200,15 @@ export class VerticalIcons {
this.events.emit('showContent', name)
}
/**
* Toggles the plugin/module
* @param {string} name Name of profile of the module to activate
*/
toggle (name) {
this.updateActivations(name)
this.events.emit('toggleContent', name)
}
updateActivations (name) {
if (name === 'home') {
this.activateHome()
@ -218,11 +227,6 @@ export class VerticalIcons {
}
}
_iconClick (name) {
this.updateActivations(name)
this.events.emit('toggleContent', name)
}
activateHome () {
globalRegistry.get('appmanager').api.ensureActivated('home')
}

Loading…
Cancel
Save