From b9026a9f4b477198eef002c2b23121df6dda414b Mon Sep 17 00:00:00 2001 From: Christian Kuhn Date: Thu, 29 Mar 2018 14:58:57 +0200 Subject: [PATCH] [TASK] Simplify modal callback handling The fix from #84499 can be simplified a bit: class "modal-content-loaded" is not needed with the callback solution. Resolves: #84559 Related: #84499 Releases: master Change-Id: I2900ecafc06579076670f8678471530d03d0b63c Reviewed-on: https://review.typo3.org/56477 Reviewed-by: Andreas Fernandez Tested-by: Andreas Fernandez Tested-by: TYPO3com Reviewed-by: Frank Naegler Tested-by: Frank Naegler --- .../Resources/Private/TypeScript/Modal.ts | 35 +++++++++---------- .../Resources/Public/JavaScript/Modal.js | 2 +- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/typo3/sysext/backend/Resources/Private/TypeScript/Modal.ts b/typo3/sysext/backend/Resources/Private/TypeScript/Modal.ts index d7b0f5ac4af2..29e8da7352fc 100644 --- a/typo3/sysext/backend/Resources/Private/TypeScript/Modal.ts +++ b/typo3/sysext/backend/Resources/Private/TypeScript/Modal.ts @@ -343,25 +343,22 @@ class Modal { if (configuration.type === 'ajax') { const contentTarget = configuration.ajaxTarget ? configuration.ajaxTarget : Identifiers.body; const $loaderTarget = currentModal.find(contentTarget); - if (!$loaderTarget.hasClass('modal-content-loaded')) { - Icons.getIcon('spinner-circle', Icons.sizes.default, null, null, Icons.markupIdentifiers.inline).done((icon: string): void => { - $loaderTarget.html(''); - $.get( - configuration.content, - (response: string): void => { - this.currentModal.find(contentTarget) - .addClass('modal-content-loaded') - .empty() - .append(response); - if (configuration.ajaxCallback) { - configuration.ajaxCallback(); - } - this.currentModal.trigger('modal-loaded'); - }, - 'html' - ); - }); - } + Icons.getIcon('spinner-circle', Icons.sizes.default, null, null, Icons.markupIdentifiers.inline).done((icon: string): void => { + $loaderTarget.html(''); + $.get( + configuration.content, + (response: string): void => { + this.currentModal.find(contentTarget) + .empty() + .append(response); + if (configuration.ajaxCallback) { + configuration.ajaxCallback(); + } + this.currentModal.trigger('modal-loaded'); + }, + 'html' + ); + }); } else if (configuration.type === 'iframe') { currentModal.find(Identifiers.body).append( $('