[BUGFIX] Fix selector of "Add more lines" 12/44212/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 22 Oct 2015 07:50:32 +0000 (09:50 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 22 Oct 2015 08:03:34 +0000 (10:03 +0200)
Due to latest changes, ``this`` refers to document now. Change the
selector to fix the event binding.

Resolves: #70935
Releases: master
Change-Id: Ic98329bb19c4ebea80b66f59eed2c1c95427811f
Reviewed-on: https://review.typo3.org/44212
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/wizard_crpages/Resources/Public/JavaScript/WizardCreatePages.js

index df23291..bf28688 100644 (file)
@@ -26,12 +26,12 @@ define(['jquery'], function($) {
 
        WizardCreatePages.createNewFormFields = function() {
                for (var i = 0; i < 5; i++) {
-                       var label = this.lineCounter + i + 1;
+                       var label = WizardCreatePages.lineCounter + i + 1;
                        var line = tpl
-                               .replace(/\{0\}/g, (this.lineCounter + i))
+                               .replace(/\{0\}/g, (WizardCreatePages.lineCounter + i))
                                .replace(/\{1\}/g, label);
 
-                       $(line).appendTo(this.containerSelector);
+                       $(line).appendTo(WizardCreatePages.containerSelector);
                }
                WizardCreatePages.lineCounter += 5;
        };
@@ -46,11 +46,11 @@ define(['jquery'], function($) {
         * Register listeners
         */
        WizardCreatePages.initializeEvents = function() {
-               $(this.addMoreFieldsButtonSelector).on('click', function() {
+               $(WizardCreatePages.addMoreFieldsButtonSelector).on('click', function() {
                        WizardCreatePages.createNewFormFields();
                });
 
-               $(document).on('change', this.doktypeSelector, function() {
+               $(document).on('change', WizardCreatePages.doktypeSelector, function() {
                        WizardCreatePages.actOnTypeSelectChange($(this));
                });
        };