<commit_before>console.log( "===== simpread option common: ThemeSel =====" )

const [ bgcolorstyl, bgcls     ] = [ "background-color", ".ks-simpread-bg" ];

export default class ThemeSel extends React.Component {

    changeBgColor () {
        if ( event.target.tagName.toLowerCase() == "sr-opt-theme" ) {
            const target     = event.target,
                  $target    = $(target),
                  $parent    = $target.parent(),
                  activestyl = "active",
                  newval     = $target.attr( "name" ),
                  $active    = $parent.find( 'sr-opt-theme[sr-type="active"]' );
                  /*
                  $active    = $parent.find( 'sr-opt-theme[sr-type="active"]' ),
                  bgcolor    = $target.css( bgcolorstyl ),
                  color      = getColor( bgcolor ),
                  opacity    = getOpacity( $( bgcls ).css( bgcolorstyl ) ),
                  newval     = `rgba(${color}, ${opacity})`;
                  */
            if ( $active ) {
                $active.removeAttr( "sr-type" );
                $target.attr( "sr-type", activestyl );
            }
            //this.props.option.bgcolor = newval;
            console.log( "this.props.option.bgcolor = ", newval )
            this.props.changeBgColor( newval );
        }<commit_msg>Optimize theme selector common component.<commit_after>console.log( "===== simpread option common: ThemeSel =====" )

export default class ThemeSel extends React.Component {

    changeBgColor () {
        if ( event.target.tagName.toLowerCase() == "sr-opt-theme" ) {
            const target     = event.target,
                  $target    = $(target),
                  $parent    = $target.parent(),
                  activestyl = "active",
                  newval     = $target.attr( "name" ),
                  $active    = $parent.find( 'sr-opt-theme[sr-type="active"]' );
            if ( $active ) {
                $active.removeAttr( "sr-type" );
                $target.attr( "sr-type", activestyl );
            }
            this.props.changeBgColor( newval, $target );
        }
{'fraction_non_alphanumeric': 0.1473783656117147, 'fraction_numerical': 0.0, 'mean_word_length': 1.5334928229665072, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4794734', 'n_tokens_mistral': 613, 'n_tokens_neox': 577, 'n_words': 110}