Fixed event schedule toggle-button showing wrong if OFF on pageload

This commit is contained in:
Jo Michael 2012-03-16 21:28:59 +01:00
parent d10d853629
commit 3277c99787

View File

@ -3060,9 +3060,9 @@ var toggleButton = function ($obj) {
// OFF state we need to move it now.
if ($('.container', $obj).hasClass('off')) {
if (right == 'right') {
$('table, img', $obj).animate({'left': '-=' + move + 'px'}, 0);
$('.container', $obj).animate({'left': '-=' + move + 'px'}, 0);
} else {
$('table, img', $obj).animate({'left': '+=' + move + 'px'}, 0);
$('.container', $obj).animate({'left': '+=' + move + 'px'}, 0);
}
}
// Attach an 'onclick' event to the switch
@ -3118,9 +3118,7 @@ var toggleButton = function ($obj) {
*/
$(window).load(function () {
$('.toggleAjax').each(function () {
$(this)
.show()
.find('.toggleButton')
$(this).show();
toggleButton($(this));
});
});