emoji-url-shortener
Version:
Own your own url shortener as a service.
17 lines (14 loc) • 486 B
JavaScript
import * as Utils from 'utils'
export class NotyButton {
constructor (html, classes, cb, attributes = {}) {
this.dom = document.createElement('button')
this.dom.innerHTML = html
this.id = (attributes.id = attributes.id || Utils.generateID('button'))
this.cb = cb
Object.keys(attributes).forEach(propertyName => {
this.dom.setAttribute(propertyName, attributes[propertyName])
})
Utils.addClass(this.dom, classes || 'noty_btn')
return this
}
}