Sha256: 73551176d1fb56c8afd6e702fbe1d1bb36506293306563467cbc75b4bfb290e8
Contents?: true
Size: 886 Bytes
Versions: 31
Compression:
Stored size: 886 Bytes
Contents
window.CMS.pageFragments = () => { const toggle = document.querySelector('select#fragments-toggle'); if (toggle === null) return; const url = new URL(toggle.dataset.url, document.location.href); toggle.addEventListener('change', () => { url.searchParams.set('layout_id', toggle.value); fetch(url, {credentials: 'same-origin'}).then((resp) => resp.text()).then((html) => { const container = document.querySelector('#form-fragments-container'); container.innerHTML = html; // TODO: Only dispose of the widgets that were within the fragment. CMS.wysiwyg.dispose(); CMS.timepicker.dispose(); CMS.codemirror.dispose(); CMS.fileLinks(container); // TODO: Container should also be passed here once the TODO above is addressed. CMS.wysiwyg.init(); CMS.timepicker.init(); CMS.codemirror.init(); }); }); };
Version data entries
31 entries across 31 versions & 7 rubygems