Mercurial > addons > firefox-addons > feed-preview
comparison options/options.js @ 64:46c0595f2dcc
Remove SubmitEvent compatibility code
This API is supported by the latest Firefox ESR release.
author | Guido Berhoerster <guido+feed-preview@berhoerster.name> |
---|---|
date | Sat, 17 Apr 2021 23:07:57 +0200 |
parents | 3c97046c2348 |
children | 106d78e26d3c |
comparison
equal
deleted
inserted
replaced
63:47b46f51aa5a | 64:46c0595f2dcc |
---|---|
27 feedReadersForm.elements['move-down'].textContent = | 27 feedReadersForm.elements['move-down'].textContent = |
28 browser.i18n.getMessage('feedReaderMoveDownButton'); | 28 browser.i18n.getMessage('feedReaderMoveDownButton'); |
29 feedReadersForm.elements['remove'].textContent = | 29 feedReadersForm.elements['remove'].textContent = |
30 browser.i18n.getMessage('feedReaderRemoveButton'); | 30 browser.i18n.getMessage('feedReaderRemoveButton'); |
31 feedReadersForm.addEventListener('change', this); | 31 feedReadersForm.addEventListener('change', this); |
32 // FIXME remove once the Firefox ESR release supports SubmitEvent | |
33 if (typeof SubmitEvent === 'undefined') { | |
34 for (let element of [ | |
35 feedReadersForm.elements['move-up'], | |
36 feedReadersForm.elements['move-down'], | |
37 feedReadersForm.elements['remove'] | |
38 ]) { | |
39 element.addEventListener('click', ev => { | |
40 ev.preventDefault(); | |
41 let submitEvent = new Event('submit', { | |
42 'bubbles':true, | |
43 'cancelable':true | |
44 }); | |
45 submitEvent.submitter = ev.target; | |
46 feedReadersForm.dispatchEvent(submitEvent) | |
47 }); | |
48 } | |
49 } | |
50 | 32 |
51 let addFeedReaderForm = document.forms['add-feed-reader']; | 33 let addFeedReaderForm = document.forms['add-feed-reader']; |
52 addFeedReaderForm.elements['add'].textContent = | 34 addFeedReaderForm.elements['add'].textContent = |
53 browser.i18n.getMessage('feedReaderAddButton'); | 35 browser.i18n.getMessage('feedReaderAddButton'); |
54 let titleElement = addFeedReaderForm.elements['title']; | 36 let titleElement = addFeedReaderForm.elements['title']; |