Sha256: 35f0cde017d383bf7abe3e3aea668420508c84f83f22aa6ee74162796d9d6a4b
Contents?: true
Size: 588 Bytes
Versions: 15
Compression:
Stored size: 588 Bytes
Contents
(function() { const Thredded = window.Thredded; Thredded.isSubmitHotkey = (evt) => { // Ctrl+Enter. return evt.ctrlKey && (evt.keyCode === 13 || evt.keyCode === 10 /* http://crbug.com/79407 */); }; document.addEventListener('keypress', (evt) => { if (Thredded.isSubmitHotkey(evt)) { const submitButton = document.querySelector('[data-thredded-submit-hotkey] [type="submit"]'); if (!submitButton) return; evt.preventDefault(); // Focus first for better visual feedback. submitButton.focus(); submitButton.click(); } }); })();
Version data entries
15 entries across 15 versions & 1 rubygems