Skip to content

Commit

Permalink
variant: fix auto mode variant detection in stylesheet generator #679
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Nov 23, 2023
1 parent 93d42ff commit 286b6a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions static/js/variant.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 286b6a1

Please sign in to comment.