[FOLLOWUP][FEATURE] Load new content element wizard via modal instead of new page 87/54587/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 8 Nov 2017 12:31:17 +0000 (13:31 +0100)
committerBenjamin Kott <benjamin.kott@outlook.com>
Wed, 8 Nov 2017 12:59:00 +0000 (13:59 +0100)
Ensure that jQuery is available in NewRecordController.

Resolves: #75676
Releases: master
Change-Id: Idf437554fb136e8e4ae18ce0d229d6b3ed8a58e4
Reviewed-on: https://review.typo3.org/54587
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Benjamin Kott <benjamin.kott@outlook.com>
Tested-by: Benjamin Kott <benjamin.kott@outlook.com>
typo3/sysext/backend/Classes/Controller/NewRecordController.php

index d4cf603..a3453eb 100644 (file)
@@ -194,8 +194,13 @@ class NewRecordController
         $this->moduleTemplate->getPageRenderer()->loadRequireJsModule(
             'TYPO3/CMS/Backend/Wizard/NewContentElement',
             'function(NewContentElement) {
-                $(".t3js-toggle-new-content-element-wizard").click(function() {
-                    NewContentElement.wizard($(this).data("url"), $(this).data("title"));
+                require([\'jquery\'], function($) {
+                    $(function() {
+                        $(\'.t3js-toggle-new-content-element-wizard\').click(function() {
+                            var $me = $(this);
+                            NewContentElement.wizard($me.data(\'url\'), $me.data(\'title\'));
+                        });
+                    });
                 });
             }'
         );