Sha256: c14cd22432fec2a63c62bb3536cc9affea65f6385ced95406f7febb5fce57abb
Contents?: true
Size: 961 Bytes
Versions: 32
Compression:
Stored size: 961 Bytes
Contents
(() => { const codeMirrorInstances = []; window.CMS.codemirror = { init(root = document) { for (const textarea of root.querySelectorAll('textarea[data-cms-cm-mode]')) { const codemirror = CodeMirror.fromTextArea(textarea, { mode: textarea.dataset.cmsCmMode, tabSize: 2, lineWrapping: true, autoCloseTags: true, lineNumbers: true, viewportMargin: Infinity }); codeMirrorInstances.push(codemirror); } const tabsRoot = root.id === 'form-fragments' ? root : root.querySelector('#form-fragments'); jQuery(tabsRoot).find('a[data-toggle="tab"]').on('shown.bs.tab', () => { for (const codemirror of codeMirrorInstances) { codemirror.refresh(); } }); }, dispose() { for (const codemirror of codeMirrorInstances) { codemirror.toTextArea(); } codeMirrorInstances.length = 0; } } })();
Version data entries
32 entries across 32 versions & 8 rubygems