Skip to content
Snippets Groups Projects
Commit 464a060c authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Daniel Goerz
Browse files

[BUGFIX] Allow sending test mails via pressing enter key

The form for sending test mails in the Install Tool now listens to the
`submit` event which allows to trigger the submit via pressing the
"enter" key.

Resolves: #90312
Releases: master, 9.5
Change-Id: Id37e285702d2bb8abc790d8b092598cf3201b8aa
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63539


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarChristian Eßl <indy.essl@gmail.com>
Tested-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: default avatarChristian Eßl <indy.essl@gmail.com>
Reviewed-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
parent a5f19efc
Branches
Tags
No related merge requests found
......@@ -37,6 +37,10 @@ class MailTest extends AbstractInteractableModule {
e.preventDefault();
this.send();
});
currentModal.on('submit', 'form', (e: JQueryEventObject): void => {
e.preventDefault();
this.send();
});
}
private getData(): void {
......
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
define(["require","exports","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(t,e,n,s,a,r,o,i,l,c){"use strict";class d extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorOutputContainer=".t3js-mailTest-output",this.selectorMailTestButton=".t3js-mailTest-execute"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorMailTestButton,t=>{t.preventDefault(),this.send()})}getData(){const t=this.getModalBody();new r(c.getUrl("mailTestGetData")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();!0===n.success?(t.empty().append(n.html),s.setButtons(n.buttons)):a.error("Something went wrong")},e=>{c.handleAjaxError(e,t)})}send(){const t=this.getModuleContent().data("mail-test-token"),e=this.findInModal(this.selectorOutputContainer),n=i.render(l.loading,"Loading...","");e.empty().html(n),new r(c.getUrl()).post({install:{action:"mailTest",token:t,email:this.findInModal(".t3js-mailTest-email").val()}}).then(async t=>{const n=await t.resolve();e.empty(),Array.isArray(n.status)?n.status.forEach(t=>{const n=o.render(t.severity,t.title,t.message);e.html(n)}):a.error("Something went wrong")},()=>{a.error("Something went wrong")})}}return new d}));
\ No newline at end of file
define(["require","exports","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(t,e,n,s,a,r,o,i,l,c){"use strict";class u extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorOutputContainer=".t3js-mailTest-output",this.selectorMailTestButton=".t3js-mailTest-execute"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorMailTestButton,t=>{t.preventDefault(),this.send()}),t.on("submit","form",t=>{t.preventDefault(),this.send()})}getData(){const t=this.getModalBody();new r(c.getUrl("mailTestGetData")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();!0===n.success?(t.empty().append(n.html),s.setButtons(n.buttons)):a.error("Something went wrong")},e=>{c.handleAjaxError(e,t)})}send(){const t=this.getModuleContent().data("mail-test-token"),e=this.findInModal(this.selectorOutputContainer),n=i.render(l.loading,"Loading...","");e.empty().html(n),new r(c.getUrl()).post({install:{action:"mailTest",token:t,email:this.findInModal(".t3js-mailTest-email").val()}}).then(async t=>{const n=await t.resolve();e.empty(),Array.isArray(n.status)?n.status.forEach(t=>{const n=o.render(t.severity,t.title,t.message);e.html(n)}):a.error("Something went wrong")},()=>{a.error("Something went wrong")})}}return new u}));
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment