[BUGFIX] JavaScript error in Install Tool 28/31828/4
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 25 Jul 2014 18:06:30 +0000 (20:06 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 12 Aug 2014 21:23:30 +0000 (23:23 +0200)
When using toggleButton in "Test setup" a JavaScript
error is thrown because the scrolling handler can only
be used if the fixed footer is available.

Add a check to prevent this JavaScript error.

Resolves: #60577
Releases: 6.3,6.2
Change-Id: Ie7628e83280f6af032b364586cdfb6b386663d9d
Reviewed-on: http://review.typo3.org/31828
Reviewed-by: Stefan Froemken <froemken@gmail.com>
Tested-by: Stefan Froemken <froemken@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Resources/Public/Javascript/Install.js

index 2f8b598..e7d4c2e 100644 (file)
@@ -43,10 +43,12 @@ TYPO3.Install.Scrolling = {
                return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
        },
        handleButtonScrolling: function() {
-               if (!this.isScrolledIntoView($('#fixed-footer-handler'))) {
-                       $('#fixed-footer').addClass('fixed');
-               } else {
-                       $('#fixed-footer').removeClass('fixed');
+               if ($('#fixed-footer-handler').length > 0) {
+                       if (!this.isScrolledIntoView($('#fixed-footer-handler'))) {
+                               $('#fixed-footer').addClass('fixed');
+                       } else {
+                               $('#fixed-footer').removeClass('fixed');
+                       }
                }
        }
 };
@@ -578,12 +580,6 @@ $(document).ready(function() {
                return false;
        });
 
-       // Footer scrolling and visibility
-       if ($('#fixed-footer-handler').length > 0) {
-               $(window).scroll(TYPO3.Install.Scrolling.handleButtonScrolling());
-               $('body.backend #typo3-docbody').scroll(TYPO3.Install.Scrolling.handleButtonScrolling());
-       }
-
        // Handle core update
        var $coreUpdateSection = $('#coreUpdate');
        if ($coreUpdateSection) {