Sha256: 580a8a5287da48c32f9114c96e139f5c9e12dcc6b1a92235cf3050d81302303a
Contents?: true
Size: 526 Bytes
Versions: 34
Compression:
Stored size: 526 Bytes
Contents
import { Controller } from 'stimulus' import SimpleMDE from 'simplemde' export default class extends Controller { static targets = ['element'] get view() { return this.elementTarget.dataset.view } connect() { const options = { element: this.elementTarget, } if (this.view === 'show') { options.toolbar = false options.status = false } const simpleMde = new SimpleMDE(options) if (this.view === 'show') { simpleMde.codemirror.options.readOnly = true } } }
Version data entries
34 entries across 34 versions & 1 rubygems