New development. Display lateral menus whit left click.

This commit is contained in:
Daniel Maya 2016-06-02 11:59:35 +02:00
parent 86b3cfe4cc
commit 0acf4f41eb
3 changed files with 101 additions and 41 deletions
pandora_console

@ -74,6 +74,7 @@ var fixed_header = <?php echo json_encode((bool)$config_fixed_header); ?>;
var id_user = "<?php echo $config['id_user']; ?>";
var cookie_name = id_user + '-pandora_menu_state';
var cookie_name_encoded = btoa(cookie_name);
var click_display = "<?php echo $config["click_display"]; ?>";
var menuState = $.cookie(cookie_name_encoded);
if (!menuState) {
@ -250,31 +251,54 @@ $(document).ready( function() {
openTime2 = 0;
handsIn = 0;
handsIn2 = 0;
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
//$('div#menu').offset().top;
//$('div#menu').css('overflow','visible');
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function() {
//$('div#menu').css('overflow', 'hidden');
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 3000 && handsIn == 0) {
openTime = 4000;
$("ul#sub"+table_hover[0].id).hide();
}
}, 3500);
});
//Daniel maya 02/06/2016 Display menu with click --INI
if(!click_display){
$('.menu_icon').mouseenter(function() {
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
if( typeof(table_noHover) != 'undefined')
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
$("ul#sub"+table_noHover[0].id).hide();
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 3000 && handsIn == 0) {
openTime = 4000;
$("ul#sub"+table_hover[0].id).hide();
}
}, 3500);
});
}else{
$(document).ready(function() {
$('.menu_icon').on("click", function() {
if( typeof(table_hover) != 'undefined'){
$("ul#sub"+table_hover[0].id).hide();
}
table_hover = $(this);
handsIn = 1;
openTime = new Date().getTime();
$("ul#sub"+table_hover[0].id).show();
}).mouseleave(function() {
table_noHover = $(this);
handsIn = 0;
setTimeout(function() {
opened = new Date().getTime() - openTime;
if(opened > 5000 && handsIn == 0) {
openTime = 6000;
$("ul#sub"+table_hover[0].id).hide();
}
}, 5500);
});
});
}
//Daniel maya 02/06/2016 Display menu with click --END
- $('.has_submenu').mouseenter(function() {
table_hover2 = $(this);
handsIn2 = 1;
@ -296,18 +320,34 @@ $(document).ready( function() {
});
$(document).ready(function() {
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
//Daniel maya 02/06/2016 Display menu with click --INI
if(!click_display){
$('#container').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
}else{
$('#main').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')
$("ul#sub"+table_hover[0].id).hide();
if( typeof(table_hover2) != 'undefined')
$("ul#sub"+table_hover2[0].id).hide();
$('#menu').css('width', '45px');
$('li.menu_icon').removeClass( " no_hidden_menu");
$('ul.submenu').css('left', '44px');
$('div#title_menu').hide();
});
}
//Daniel maya 02/06/2016 Display menu with click --END
$('div.menu>ul>li>ul>li>a').click(function() {
openTime = 4000;
if( typeof(table_hover) != 'undefined')

@ -99,6 +99,19 @@ $table_behaviour->data[$row][0] = __('Display text when proc modules have state
$table_behaviour->data[$row][1] = html_print_input_text ('render_proc_fail', $config["render_proc_fail"], '', 25, 25, true);
$row++;
//Daniel maya 02/06/2016 Display menu with click --INI
$table_behaviour->data[$row][0] = __('Display lateral menus with click').
ui_print_help_tip(__('If you check this option, the lateral menus display with left click. Otherwise it will show by placing the mouse over'), true);
$table_behaviour->data[$row][1] = __('Yes') . '&nbsp;' .
html_print_radio_button ('click_display', 1, '',
$config["click_display"], true) .
'&nbsp;&nbsp;';
$table_behaviour->data[$row][1] .= __('No') . '&nbsp;' .
html_print_radio_button ('click_display', 0, '',
$config["click_display"], true);
$row++;
//Daniel maya 02/06/2016 Display menu with click --END
echo "<fieldset>";
echo "<legend>" . __('Behaviour configuration') . "</legend>";
html_print_table ($table_behaviour);

@ -498,9 +498,12 @@ function config_update_config () {
$error_update[] = __('Display text proc modules have state is ok');
if (!config_update_value ('render_proc_fail', (string) get_parameter('render_proc_fail', __('Fail') )))
$error_update[] = __('Display text when proc modules have state critical');
//Daniel maya 02/06/2016 Display menu with click --INI
if (!config_update_value ('click_display', (bool) get_parameter('click_display', false)))
$error_update[] = __('Display data of proc modules in other format');
//Daniel maya 02/06/2016 Display menu with click --END
//--------------------------------------------------
// CUSTOM VALUES POST PROCESS
//--------------------------------------------------
@ -1389,7 +1392,11 @@ function config_process_config () {
if (!isset($config["render_proc_fail"])) {
config_update_value ('render_proc_fail', __('Fail') );
}
//Daniel maya 02/06/2016 Display menu with click --INI
if (!isset($config["click_display"])) {
config_update_value ('click_display', 0);
}
//Daniel maya 02/06/2016 Display menu with click --END
if (!isset($config['command_snapshot'])) {
config_update_value ('command_snapshot', 1);
}