function createButton(icon) {
  const image = document.createElement('img')
  image.src = icon.src
  image.classList.add(CLASSES.ICON_IMG)
  if (icon.spinning) {
    image.classList.add(CLASSES.ICON_IMG_SPINNING)
  }
  const container = document.createElement('div')
  container.title = icon.title
  container.classList.add(CLASSES.ICON_CONTAINER)
  container.classList.add(CLASSES.ICON_CONTAINER_BUTTON)
  container.appendChild(image)
  return container
}
// Create a new button in the DOM based on the given icon constant.
Create a new button in the DOM based on the given icon constant.
Create a new button in the DOM based on the given icon constant .
function createButton(icon) {
  const image = document.createElement('img')
  image.src = icon.src
  image.classList.add(CLASSES.ICON_IMG)
  if (icon.spinning) {
    image.classList.add(CLASSES.ICON_IMG_SPINNING)
  }
  const container = document.createElement('div')
  container.title = icon.title
  container.classList.add(CLASSES.ICON_CONTAINER)
  container.classList.add(CLASSES.ICON_CONTAINER_BUTTON)
  container.appendChild(image)
  return container
}
function createButton ( icon ) { const image = document . createElement ( 'img' ) image . src = icon . src image . classList . add ( CLASSES . ICON_IMG ) if ( icon . spinning ) { image . classList . add ( CLASSES . ICON_IMG_SPINNING ) } const container = document . createElement ( 'div' ) container . title = icon . title container . classList . add ( CLASSES . ICON_CONTAINER ) container . classList . add ( CLASSES . ICON_CONTAINER_BUTTON ) container . appendChild ( image ) return container }
Create a new button in the DOM based on the given icon constant.
Create a new button in the DOM based on the given icon constant .