static/js/interface.js
/**
 * Initialize button groups.
 * @function initBtnGroups
 * @description Currently there are no button groups.
 */
Initialize button groups.
@function initBtnGroups
@description Currently there are no button groups.
Initialize button groups . @function initBtnGroups @description Currently there are no button groups .
function initBtnGroups() {
  const groups = document.getElementsByClassName('btn-group');
  let btns, btn;
  for (let group of groups) {
    btns = group.getElementsByTagName('button');
    for (btn of btns) {
      btn.addEventListener('click', function () {
        if (this.classList.contains('pressed')) return;
        btns = this.parentElement.getElementsByTagName('button');
        for (let btn of btns) {
          if (btn !== this) btn.classList.remove('pressed');
        }
        this.classList.add('pressed');
      });
    }
  }
}
function initBtnGroups ( ) { const groups = document . getElementsByClassName ( 'btn-group' ) ; let btns , btn ; for ( let group of groups ) { btns = group . getElementsByTagName ( 'button' ) ; for ( btn of btns ) { btn . addEventListener ( 'click' , function ( ) { if ( this . classList . contains ( 'pressed' ) ) return ; btns = this . parentElement . getElementsByTagName ( 'button' ) ; for ( let btn of btns ) { if ( btn !== this ) btn . classList . remove ( 'pressed' ) ; } this . classList . add ( 'pressed' ) ; } ) ; } } }
Initialize button groups.
Initialize button groups .