[BUGFIX] Fix multiple "Quit without saving?" messages 60/41160/4
authorFrank Nägler <typo3@naegler.net>
Tue, 14 Jul 2015 07:33:40 +0000 (09:33 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 14 Jul 2015 08:01:49 +0000 (10:01 +0200)
In some cases, the event handler was bind multiple times.
This patch moves the binding into a new place.

Resolves: #68095
Releases: master
Change-Id: I40aeb1305b6e0c061a202ddb31a9e8f9fc9b9630
Reviewed-on: http://review.typo3.org/41160
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js

index d9cbe77..fa31ca4 100644 (file)
@@ -575,6 +575,11 @@ define('TYPO3/CMS/Backend/FormEngine', ['jquery'], function ($) {
                                });
                        }
                });
+
+               $(document).on('click', '.t3js-editform-close', function(e) {
+                       e.preventDefault();
+                       FormEngine.preventExitIfNotSaved();
+               });
        };
 
        /**
@@ -738,10 +743,6 @@ define('TYPO3/CMS/Backend/FormEngine', ['jquery'], function ($) {
                });
                FormEngine.convertTextareasResizable();
                FormEngine.convertTextareasEnableTab();
-               $(document).on('click', '.t3js-editform-close', function(e) {
-                       e.preventDefault();
-                       FormEngine.preventExitIfNotSaved();
-               });
        };
 
        /**