diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 0306a48eb99..ea1734353d3 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -905,7 +905,7 @@ class DolGraph { global $conf; - if ($direction == 'width') return ($conf->dol_optimize_smallscreen?'400':($defaultsize?$defaultsize:'500')); + if ($direction == 'width') return ($conf->dol_optimize_smallscreen?(empty($_SESSION['dol_screen_width'])?'280':$_SESSION['dol_screen_width']-40):($defaultsize?$defaultsize:'500')); if ($direction == 'height') return ($conf->dol_optimize_smallscreen?'160':($defaultsize?$defaultsize:'200')); return 0; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d342507a8f3..ae60706f523 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3476,7 +3476,7 @@ class Form if ($fullday) $reset_scripts .= ' } '; } // If reset_scripts is not empty, print the button with the reset_scripts in OnClick - if ($reset_scripts) + if ($reset_scripts && empty($conf->dol_optimize_smallscreen)) { $retstring.='