Feature #16249
closedGMENU_LAYERS: 4 features / patch suggestions
0%
Description
The attached patch suggests four modifications of the gmenu_layers.php:
1) A quickfix for hideMenuWhenNotOver set and Konqueror:
No idea if this is really necessary but I never figured out how to have collapsing GMENU_LAYERS working with Konqueror. It seems that mousout will always trigger Konqueror to hide the layers with hideMenuWhenNotOver set even if the mouse enters a submenu-layer. This renders GMENU_LAYERS unusable in Konqueror (at least that's my experience). The included fix will just ignore hideMenuWhenNotOver if the client is Konqueror - so this at best must be considered as a quickfix.
2) New TS parameter lockPosition_adjust.[uid of triggering Page/Item]
It sometimes is pretty handy to have a possibility for manual adjustment for the position of certain submenu layers. lockPosition_adjust.[uid] enables GMENU_LAYERS to do this: just replace [uid] with the id of the triggering Item (generally a page uid) and enter an int value as amount of pixels that is added/subtracted to the position where the submenu would pop with lockPosition set and the submenu for this uid will be displaced by that amount.
3) Changing JS triggered CSS positioning from 'left' to 'marginLeft' since marginLeft produces less "erratic" behaviour in situations where layers are positioned relativly (see 4)
4) Wrapping the layer divs by three additional div-containers
This suggests to have an easy possibility to position layers relativly (eg for centered layouts).
This goal can be achieved as well with relativeToTriggerItem and relativeToParentLayer or other more or less complex TS and wrapping setups. Though, imo these approaches tend to be quite complex (relativeToTriggerItem and relativeToParentLayer will solve it with JavaScript that is not that compatible regarding older browsers. Common other approaches will do the following by wrapping the body tag and the very first content, which isn't that clean and could be easily done by gmenu_layers.php).
With this patch, the layer-divs get wrapped by div#gmenu_layers_layerScopeBody div#gmenu_layers_layerScope1 div#gmenu_layers_layerScope2 and could be easily positioned.
Example for centered layout after applying this patch:
div#gmenu_layers_layerScopeBody {
width:100%;
text-align:center;
}
div#gmenu_layers_layerScope1 {
margin-left:auto;
margin-right:auto;
width:800px; /* width of centered layout /
text-align:left; / alignment of centered navigation /
}
div#gmenu_layers_layerScope2 {
padding-left:100px; / example for left offset inside the centered layout */
}
(issue imported from #M3685)
Files