From 8d2200df18f6dfce040b78064a1b90bcd7173c75 Mon Sep 17 00:00:00 2001 From: JezerM Date: Fri, 25 Jun 2021 22:38:21 -0600 Subject: [PATCH] Background selector fixed --- themes/default/js/greeter.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/default/js/greeter.js b/themes/default/js/greeter.js index d6f02a3..3196d3c 100644 --- a/themes/default/js/greeter.js +++ b/themes/default/js/greeter.js @@ -305,8 +305,9 @@ class BackgroundManager { } random_bg = Math.floor( Math.random() * _config.background_images.length ); + let image = _config.background_images[random_bg]; - return _config.background_images[ random_bg ]; + return image; } @@ -355,7 +356,7 @@ class BackgroundManager { */ background_selected_handler( event ) { let $target = $( event.target ), - image = $target.attr( 'data-img' ); + image = event.target.parentElement.dataset.img $( '.bg.active' ).removeClass( 'active' ); $target.addClass( 'active' );