From 286b6a13ac2a0d71b6547b5a5bb146c4dac23e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 23 Nov 2023 21:51:01 +0100 Subject: [PATCH] variant: fix auto mode variant detection in stylesheet generator #679 --- static/js/variant.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/static/js/variant.js b/static/js/variant.js index 33a274b921..c8812c9575 100644 --- a/static/js/variant.js +++ b/static/js/variant.js @@ -353,18 +353,18 @@ var variants = { changeColor: function( c, without_prompt ){ var with_prompt = !(without_prompt || false); - if( this.getVariant() == 'auto' ){ - if( with_prompt ){ - alert( 'The Auto variant can not be changed. Please select the light/dark variant directly to make changes' ); - } - return; - } var read_style = this.findLoadedStylesheet( 'R-custom-variant-style' ); var write_style = this.findLoadedStylesheet( 'R-variant-style' ); if( !read_style ){ read_style = write_style; } + if( !read_style ){ + if( with_prompt ){ + alert( 'A auto mode variant can not be changed. Please select its light/dark variant directly to make changes' ); + } + return; + } var e = this.findColor( c ); var v = this.getColorProperty( c, read_style );