How to use the zoid.EVENT function in zoid

To help you get started, we’ve selected a few zoid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SeedVault / Hadron / src / hadron.launcher.js View on Github external
prerenderFrame.classList.add(CLASS.VISIBLE);
          frame.classList.add(CLASS.INVISIBLE);
      
          event.on(zoid.EVENT.RENDERED, () => {
              prerenderFrame.classList.remove(CLASS.VISIBLE);
              prerenderFrame.classList.add(CLASS.INVISIBLE);
      
              frame.classList.remove(CLASS.INVISIBLE);
              frame.classList.add(CLASS.VISIBLE);
      
              setTimeout(() => {
                  destroyElement(prerenderFrame);
              }, 1000);
          });

          event.on(zoid.EVENT.RESIZE, ({ width: newWidth, height: newHeight }) => {
              if (typeof newWidth === 'number') {
                  div.style.width = toCSS(newWidth);
              }
      
              if (typeof newHeight === 'number') {
                  div.style.height = toCSS(newHeight);
              }
          });

          return div;
      }})
    }
github SeedVault / Hadron / src / hadron.launcher.js View on Github external
frame.setAttribute('allowusermedia', true)
          frame.setAttribute('allow', 'microphone *; camera *; geolocation *; autoplay; fullscreen;')

          div.appendChild(frame);

          prerenderFrame.setAttribute('class', 'hadron-iframe quark_chat_' + this.sizeClass);
          prerenderFrame.setAttribute('frameborder', 0)
          prerenderFrame.setAttribute('scrolling', 'no')

          div.appendChild(prerenderFrame);
          div.appendChild(style);        

          prerenderFrame.classList.add(CLASS.VISIBLE);
          frame.classList.add(CLASS.INVISIBLE);
      
          event.on(zoid.EVENT.RENDERED, () => {
              prerenderFrame.classList.remove(CLASS.VISIBLE);
              prerenderFrame.classList.add(CLASS.INVISIBLE);
      
              frame.classList.remove(CLASS.INVISIBLE);
              frame.classList.add(CLASS.VISIBLE);
      
              setTimeout(() => {
                  destroyElement(prerenderFrame);
              }, 1000);
          });

          event.on(zoid.EVENT.RESIZE, ({ width: newWidth, height: newHeight }) => {
              if (typeof newWidth === 'number') {
                  div.style.width = toCSS(newWidth);
              }