The frontend/UI server, written in JS using the MarkoJS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
474 B

6 years ago
6 years ago
  1. module.exports = class {
  2. onCreate(input) {
  3. this.state = {
  4. classes: ["menu-link", "color-menu"],
  5. }
  6. if (input.dark) {
  7. this.state.classes.push(input)
  8. }
  9. if (Array.isArray(input.class)) {
  10. this.state.classes.push(...input.class)
  11. } else if (input.class != null) {
  12. this.state.classes.push(input.class)
  13. }
  14. this.state.classes.push(input.selected ? "selected" : "not-selected")
  15. }
  16. onClick() {
  17. this.emit("click")
  18. }
  19. }