2013-02-04 Miguel de Dios <miguel.dedios@artica.es>

* include/functions_ui.php: fixed the javascript of function
	"ui_toggle".




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7578 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-02-04 17:21:04 +00:00
parent 639e0edcb0
commit f31fdc5546
2 changed files with 22 additions and 11 deletions

View File

@ -1,3 +1,8 @@
2013-02-04 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: fixed the javascript of function
"ui_toggle".
2013-02-04 Ramon Novoa <rnovoa@artica.es>
* include/functions_config.php: Added the config variable

View File

@ -1780,17 +1780,23 @@ function ui_toggle($code, $name, $title = '', $hidde_default = true, $return = f
$output .= "</div>";
// JQuery Toggle
$output .= '<script type="text/javascript">';
$output .= '/* <![CDATA[ */';
$output .= "$(document).ready (function () {";
$output .= "$('#tgl_ctrl_".$uniqid."').toggle(function() {";
$output .= $toggle_a;
$output .= "$('#image_".$uniqid."').attr({src: '".$image_a."'});";
$output .= "}, function() {";
$output .= $toggle_b;
$output .= "$('#image_".$uniqid."').attr({src: '".$image_b."'});";
$output .= "});";
$output .= "});";
$output .= '<script type="text/javascript">' . "\n";
$output .= " var hide_tgl_ctrl_" . $uniqid . " = " . (int)$hidde_default . ";\n";
$output .= ' /* <![CDATA[ */' . "\n";
$output .= " $(document).ready (function () {\n";
$output .= " $('#tgl_ctrl_".$uniqid."').click(function() {\n";
$output .= " if (hide_tgl_ctrl_" . $uniqid . ") {\n";
$output .= " hide_tgl_ctrl_" . $uniqid . " = 0;\n";
$output .= " " . $toggle_a . ";\n";
$output .= " $('#image_".$uniqid."').attr({src: '".$image_a."'});\n";
$output .= " }\n";
$output .= " else {\n";
$output .= " hide_tgl_ctrl_" . $uniqid . " = 1;\n";
$output .= " " . $toggle_b . ";\n";
$output .= " $('#image_".$uniqid."').attr({src: '".$image_b."'});\n";
$output .= " }\n";
$output .= " });\n";
$output .= " });\n";
$output .= '/* ]]> */';
$output .= '</script>';