Move javascript for sliders to functions.js.

This commit is contained in:
Michal Čihař
2011-02-02 16:04:22 +01:00
parent 3cb9916d8b
commit a0d08a3321
2 changed files with 29 additions and 36 deletions

View File

@@ -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) {
$('<span id="anchor_status_' + e.id + '"><span>')
.insertBefore(e);
PMA_set_status_label(e.id);
$('<a href="#' + e.id + '" id="anchor_' + e.id + '">' + e.title + '</a>')
.insertBefore(e)
.click(function() {
$('#' + e.id).toggle('clip');
PMA_set_status_label(e.id);
return false;
});
});
}) // end of $(document).ready()