Sha256: fef7f334ffd081bcf6c5ae491d8b80ecb2c58802dfbad962b77f59084370bd2f

Contents?: true

Size: 507 Bytes

Versions: 3

Compression:

Stored size: 507 Bytes

Contents

// eslint-disable-next-line no-unused-vars
function removeClass (element, className) {
  if (element.classList) {
    element.classList.remove(className)
  } else {
    element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ')
  }
}

// eslint-disable-next-line no-unused-vars
function addClass (element, className) {
  if (element.classList) {
    element.classList.add(className)
  } else {
    element.className += ' ' + className
  }
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elabs-3.0.0 app/assets/javascripts/elabs/helpers.js
elabs-2.0.0 app/assets/javascripts/elabs/helpers.js
elabs-2.0.0.pre app/assets/javascripts/elabs/helpers.js