IESelectFix by Peter Klein <peter at umloud.dk>. Makes layer menus flow over <select...
authorIngmar Schlecht <ingmar.schlecht@typo3.org>
Tue, 1 Feb 2005 17:08:13 +0000 (17:08 +0000)
committerIngmar Schlecht <ingmar.schlecht@typo3.org>
Tue, 1 Feb 2005 17:08:13 +0000 (17:08 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@545 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/cms/tslib/media/scripts/gmenu_layers.php
typo3/sysext/cms/tslib/media/scripts/jsfunc.layermenu.js
typo3/sysext/cms/tslib/media/scripts/tmenu_layers.php

index 0944f4f..8b9072c 100644 (file)
@@ -176,6 +176,8 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                        if ($this->WMisSub)     {
                                $event="GL_stopMove('".$this->WMid."');";
                                $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover'];
+                                       // IESelectFix - Activates IFRAME layer below menu
+                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
                                        // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
                                        // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
                                if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
@@ -183,7 +185,9 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                                }
                                $this->I['linkHREF']['onMouseout'].=$event;
                        } else {
-                               $this->I['linkHREF']['onMouseover']='GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover'];
+                               $this->I['linkHREF']['onMouseover'] = 'GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover'];
+                                       // IESelectFix - Hides IFRAME layer below menu
+                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover'] = $this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'\',false);';
                                $event='GL_resetAll("'.$this->WMid.'");';
                                $this->I['linkHREF']['onMouseout'].=$event;
                        }
@@ -217,7 +221,6 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
        GL_getObjCss("Menu'.$this->WMid.$key.'").visibility = "hidden";';
                                $this->WMlastKey = 'Menu'.$this->WMid.$key;
                        }
-
                        if (!$this->mconf['lockPosition_addSelf'])              {
                                $this->WMy+=(strcmp($this->mconf['setFixedHeight'],'')?$this->mconf['setFixedHeight']:$this->I['val']['output_h'])+intval($this->mconf['lockPosition_adjust']);
                                $this->WMx+=(strcmp($this->mconf['setFixedWidth'],'')?$this->mconf['setFixedWidth']:$this->I['val']['output_w'])+intval($this->mconf['lockPosition_adjust']);
@@ -343,6 +346,12 @@ GL_restoreMenu("'.$mIdStr.'");';
 if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null)      resetSubMenu=0;';
                        }
                }
+                       // IESelectFix - Adds IFRAME tag to HTML, Hides IFRAME layer below menu
+               if ($this->mconf['ieSelectFix']) {
+                       $this->WMhideCode.= '
+       GL_iframer(\''.$this->WMid.'\',\'\',false);';
+                       $this->divLayers['iframe'] = '<iframe id="Iframe'.$this->WMid.'" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; background-color:transparent; layer-background-color:transparent; display:none;"></iframe>';
+               }
                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array_merge($this->WMtempStore,$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']);
                $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.$GLOBALS['TSFE']->absRefPrefix.'media/scripts/jsfunc.layermenu.js"></script>';
                $GLOBALS['TSFE']->JSCode.= '
index 082a2ba..0badf12 100755 (executable)
@@ -178,3 +178,20 @@ function GL_hideAll(WMid)  {
        GLV_hasBeenOver[WMid]=0;
 }
 
+function GL_iframer(WMid,id,state)     {
+       if (bw.ie4||bw.ie5) {
+               ifrmObj = bw.ie4?document.all["Iframe"+WMid]:document.getElementById("Iframe"+WMid);
+               if (state) {
+                       parentObj = bw.ie4?document.all[id]:document.getElementById(id);
+                       ifrmObj.style.filter='Alpha(opacity=0)';
+                       ifrmObj.style.width = parentObj.offsetWidth + "px";
+                       ifrmObj.style.height = parentObj.offsetHeight + "px";
+                       ifrmObj.style.left = parentObj.offsetLeft + "px";
+                       ifrmObj.style.top = parentObj.offsetTop + "px";
+                       ifrmObj.style.zIndex = parentObj.style.zIndex-1;
+                       ifrmObj.style.display = "";
+               }
+               else ifrmObj.style.display = "none";
+       }
+}
+
index 7cbe301..83e30f4 100644 (file)
@@ -177,6 +177,8 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                        if ($this->WMisSub)     {
                                $event="GL_stopMove('".$this->WMid."');";
                                $this->I['linkHREF']['onMouseover']='GL_doTop(\''.$this->WMid.'\', \'Menu'.$this->WMid.$key.'\');'.$this->I['linkHREF']['onMouseover'];
+                                       // IESelectFix - Activates IFRAME layer below menu
+                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover']=$this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'Menu'.$this->WMid.$key.'\',true);';
                                        // Added 120802; This means that everytime leaving a menuitem the layer should be shut down (and if the layer is hit in the meantime it is not though).
                                        // This should happen only for items that are auto-hidden when not over and possibly only when a hide-timer is set. Problem is if the hide-timer is not set and we leave the main element, then the layer will be hidden unless we reach the layer before the timeout will happen and the menu hidden.
                                if (t3lib_div::intInRange($this->mconf['hideMenuWhenNotOver'],0,600) && $this->mconf['hideMenuTimer'])  {
@@ -185,6 +187,8 @@ GLV_restoreMenu["'.$this->WMid.'"] = "'.$this->WMactiveKey.'";
                                $this->I['linkHREF']['onMouseout'].=$event;
                        } else {
                                $this->I['linkHREF']['onMouseover']='GL_hideAll("'.$this->WMid.'");'.$this->I['linkHREF']['onMouseover'];
+                                       // IESelectFix - Hides IFRAME layer below menu
+                               if ($this->mconf['ieSelectFix']) $this->I['linkHREF']['onMouseover'] = $this->I['linkHREF']['onMouseover'].'GL_iframer(\''.$this->WMid.'\',\'\',false);';
                                $event='GL_resetAll("'.$this->WMid.'");';
                                $this->I['linkHREF']['onMouseout'].=$event;
                        }
@@ -344,6 +348,12 @@ GL_restoreMenu("'.$mIdStr.'");';
 if (!GLV_doReset["'.$mIdStr.'"] && GLV_currentLayer["'.$mIdStr.'"]!=null)      resetSubMenu=0;';
                        }
                }
+                       // IESelectFix - Adds IFRAME tag to HTML, Hides IFRAME layer below menu
+               if ($this->mconf['ieSelectFix']) {
+                       $this->WMhideCode.= '
+       GL_iframer(\''.$this->WMid.'\',\'\',false);';
+                       $this->divLayers['iframe'] = '<iframe id="Iframe'.$this->WMid.'" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; background-color:transparent; layer-background-color:transparent; display:none;"></iframe>';
+               }
                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']=array_merge($this->WMtempStore,$GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid']);
                $GLOBALS['TSFE']->additionalHeaderData['gmenu_layer_shared']='<script type="text/javascript" src="'.$GLOBALS['TSFE']->absRefPrefix.'media/scripts/jsfunc.layermenu.js"></script>';
                $GLOBALS['TSFE']->JSCode.= '