mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-23 13:41:01 +01:00
Fix broken onmouseover|click prefs for extraApp and sidebox menus
This commit is contained in:
parent
11d77f3dab
commit
e5b1c65045
@ -123,6 +123,15 @@ class idots_framework extends egw_framework
|
|||||||
}
|
}
|
||||||
self::validate_file('/phpgwapi/templates/idots/js/idots.js');
|
self::validate_file('/phpgwapi/templates/idots/js/idots.js');
|
||||||
}
|
}
|
||||||
|
if ($GLOBALS['egw_info']['user']['preferences']['common']['click_or_onmouseover'] == 'onmouseover' && !html::$ua_mobile)
|
||||||
|
{
|
||||||
|
$show_menu_event = 'mouseover';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$show_menu_event = 'click';
|
||||||
|
}
|
||||||
|
$extra['slide-out'] = $show_menu_event;
|
||||||
|
|
||||||
$this->tpl->set_var($this->_get_header($extra));
|
$this->tpl->set_var($this->_get_header($extra));
|
||||||
|
|
||||||
|
@ -18,7 +18,14 @@ egw_LAB.wait(function() {
|
|||||||
var quick_add = document.getElementById('quick_add');
|
var quick_add = document.getElementById('quick_add');
|
||||||
if (quick_add) egw.link_quick_add(quick_add);
|
if (quick_add) egw.link_quick_add(quick_add);
|
||||||
|
|
||||||
// instanciate slideout menus via "data-slide-out" of egw.js script tag
|
// Handle sliding menues of extra apps and sidebox
|
||||||
|
var egw_script = document.getElementById('egw_script_id');
|
||||||
|
var mouseHandler = 'click';
|
||||||
|
if (egw_script)
|
||||||
|
{
|
||||||
|
var data_slide_out = egw_script.getAttribute('data-slide-out');
|
||||||
|
mouseHandler = data_slide_out == 'mouseover'?'mouseover':'click';
|
||||||
|
}
|
||||||
var extra_icons_show = jQuery('#extra_icons_show');
|
var extra_icons_show = jQuery('#extra_icons_show');
|
||||||
var menu1Container = jQuery('#menu1Container')
|
var menu1Container = jQuery('#menu1Container')
|
||||||
.width(180)
|
.width(180)
|
||||||
@ -26,10 +33,9 @@ egw_LAB.wait(function() {
|
|||||||
var menu2show = jQuery('#menu2show');
|
var menu2show = jQuery('#menu2show');
|
||||||
var menu2Container = jQuery('#menu2Container');
|
var menu2Container = jQuery('#menu2Container');
|
||||||
//Click handler for extra apps menu
|
//Click handler for extra apps menu
|
||||||
extra_icons_show.on({
|
extra_icons_show.on(mouseHandler,function (event){
|
||||||
click:function (event){
|
|
||||||
var extraIcon = event;
|
var extraIcon = event;
|
||||||
$j('html').on('click',function(event) {
|
$j('html').on(mouseHandler,function(event) {
|
||||||
if ($j(event.target).parents('#menu1Container').length==0 && event.target !== extraIcon.target)
|
if ($j(event.target).parents('#menu1Container').length==0 && event.target !== extraIcon.target)
|
||||||
{
|
{
|
||||||
menu1Container.slideUp();
|
menu1Container.slideUp();
|
||||||
@ -38,10 +44,9 @@ egw_LAB.wait(function() {
|
|||||||
});
|
});
|
||||||
menu1Container.slideToggle();
|
menu1Container.slideToggle();
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
// Click handler for sidebox menu
|
// Click handler for sidebox menu
|
||||||
menu2show.on({
|
menu2show.on(mouseHandler,function (event){
|
||||||
click:function (event){
|
|
||||||
var m2showIcon = event;
|
var m2showIcon = event;
|
||||||
var options = {
|
var options = {
|
||||||
direction: "left"
|
direction: "left"
|
||||||
@ -55,7 +60,7 @@ egw_LAB.wait(function() {
|
|||||||
});
|
});
|
||||||
menu2Container.toggle("slide",options);
|
menu2Container.toggle("slide",options);
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialisation, when DOM is ready
|
* Initialisation, when DOM is ready
|
||||||
|
Loading…
Reference in New Issue
Block a user