Fixed bug #14508: Fixes to the Page module: Add missing js file as follow-up to ...
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 28 May 2010 20:55:54 +0000 (20:55 +0000)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 28 May 2010 20:55:54 +0000 (20:55 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7733 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/layout/js/typo3pageModule.js [new file with mode: 0644]

index 7284e32..bb1e0ae 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,7 @@
 
 2010-05-28  Christian Kuhn  <lolli@schwarzbu.ch>
 
+       * Fixed bug #14508: Fixes to the Page module: Add missing js file as follow-up to #14490
        * Fixed bug #13636: sysext:version needs doNotLoadInFE => 0 (Thanks to Georg Ringer)
        * Fixed bug #9731: Wrong XCLASS definition in t3lib/t3lib_rteapi.php (Thanks to Marcus Schwemer)
        * Fixed bug #7015: t3lib_DB displays wrong SQL in error case (Thanks to Steffen Ritter)
diff --git a/typo3/sysext/cms/layout/js/typo3pageModule.js b/typo3/sysext/cms/layout/js/typo3pageModule.js
new file mode 100644 (file)
index 0000000..1b003fa
--- /dev/null
@@ -0,0 +1,64 @@
+var typo3pageModule = {
+       /**
+        * Initialization
+        */
+       init: function() {
+               if (Ext.isIE) {
+                       // set all content elements active
+                       // the whole functionality doesn't work in IE6-8
+                       Ext.select('div.t3-page-ce').addClass('active');
+               } else {
+                       typo3pageModule.enableHighlighting();
+               }
+       },
+
+       /**
+        * This method is used to bind the higlighting function "setActive"
+        * to the mouseenter event and the "setInactive" to the mouseleave event.
+        */
+       enableHighlighting: function() {
+               Ext.select('div.t3-page-ce')
+                       .on('mouseenter',
+                               typo3pageModule.setActive,
+                               typo3pageModule)
+                       .on('mouseleave',
+                               typo3pageModule.setInactive,
+                               typo3pageModule);
+       },
+
+       /**
+        * This method is used to unbind the higlighting function "setActive"
+        * from the mouseenter event and the "setInactive" from the mouseleave event.
+        */
+       disableHighlighting: function() {
+               Ext.select('div.t3-page-ce')
+                       .un('mouseenter',
+                               typo3pageModule.setActive,
+                               typo3pageModule)
+                       .un('mouseleave',
+                               typo3pageModule.setInactive,
+                               typo3pageModule);
+       },
+
+       /**
+        * This method is used as an event handler when the 
+        * user hovers the a content element.
+        */
+       setActive: function(e, t) {
+               Ext.get(t).findParent('div.t3-page-ce', null, true).addClass('active');
+       },
+
+       /**
+        * This method is used as event handler to unset active state of
+        * a content element when the mouse of the user leaves the 
+        * content element.
+        */
+       setInactive: function(e, t) {
+               Ext.get(t).findParent('div.t3-page-ce', null, true).removeClass('active');
+               
+       }
+}
+
+Ext.onReady(function() {
+       typo3pageModule.init();
+});
\ No newline at end of file