From a0d08a33214dd14e407a4eefe587f3b618bc17c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 2 Feb 2011 16:04:22 +0100 Subject: [PATCH] Move javascript for sliders to functions.js. --- js/functions.js | 28 ++++++++++++++++++++++++++++ libraries/common.lib.php | 37 +------------------------------------ 2 files changed, 29 insertions(+), 36 deletions(-) diff --git a/js/functions.js b/js/functions.js index d8f75cf63..24dc0a3c0 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2410,6 +2410,17 @@ function PMA_getRowNumber(classlist) { return parseInt(classlist.split(/row_/)[1]); } +/** + * Changes status of slider + */ +function PMA_set_status_label(id) { + if ($('#' + id).css('display') == 'none') { + $('#anchor_status_' + id).text('+ '); + } else { + $('#anchor_status_' + id).text('- '); + } +} + /** * Vertical pointer */ @@ -2478,5 +2489,22 @@ $(document).ready(function() { })(); } + /** + * Slider effect. + */ + $('.pma_auto_slider').each(function(idx, e) { + $('') + .insertBefore(e); + PMA_set_status_label(e.id); + + $('' + e.title + '') + .insertBefore(e) + .click(function() { + $('#' + e.id).toggle('clip'); + PMA_set_status_label(e.id); + return false; + }); + }); + }) // end of $(document).ready() diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 6b4706068..ac79a1224 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2524,42 +2524,7 @@ function PMA_generate_slider_effect($id, $message) * maybe by using an additional param, the id of the div to append to */ ?> -