header.js 939 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import page from '/lib/page.mjs';
  2. class Header {
  3. constructor() {
  4. console.log("app constructor");
  5. this.language = _LangManager.language;
  6. }
  7. init(){
  8. let el = document.createElement("div");
  9. el.setAttribute("id", "header");
  10. document.body.appendChild(el);
  11. let headerGUI = {
  12. $type: "a",
  13. class: "mdc-button mdc-button--compact mdc-card__action",
  14. $text: "Back",
  15. //href: "/" + desc[2] + '/worlds/' + desc[0] + '/edit', ///:user/worlds/:name/edit
  16. onclick: function (e) {
  17. window.history.back();
  18. }
  19. }
  20. document.querySelector("#header").$cell({
  21. id: 'header',
  22. $cell: true,
  23. $type: "div",
  24. $components: [
  25. headerGUI
  26. ]
  27. })
  28. }
  29. }
  30. export { Header }