Skip to content
Snippets Groups Projects
vote-page.js 793 B
Newer Older
  • Learn to ignore specific revisions
  • // Imports
    import * as DeskRound from "/components/vote/desk-round.js";
    import * as Vote from "/components/vote/votes.js";
    
    // DOM elements
    
    export async function mount(where) {
      const votePage = new VotePage();
      await votePage.mount(where);
    }
    
    class VotePage {
      constructor() {}
    
      async mount(where) {
        const mountpoint = where;
        document.getElementById(mountpoint).innerHTML = /* HTML */ `
          <section style="margin-bottom: 230px;">
            <div class="container"><div id="vote-section" class="card"></div></div>
          </section>
        `;
        this.deskRoundHandler = await DeskRound.mount("vote-section", this);
        this.voteHandler = await Vote.mount(this);
        this.handleDom();
      }
    
      handleDom() {}
    
      async refreshVotes(){
        this.voteHandler = await Vote.mount(this);
      }