Sha256: 046ca68c0ef990f39f4f24c6496006efce181e3a2f594a616f3a258bcddf3108
Contents?: true
Size: 499 Bytes
Versions: 31
Compression:
Stored size: 499 Bytes
Contents
import { Controller } from '@hotwired/stimulus' export default class extends Controller { static targets = ['container'] connect() { window.toastr[this.type](this.message) } get type() { const typeMap = { info: 'info', warning: 'warning', success: 'success', error: 'error', notice: 'info', alert: 'error', } return typeMap[this.containerTarget.dataset.alertType] } get message() { return this.containerTarget.innerHTML } }
Version data entries
31 entries across 31 versions & 1 rubygems