@@ -81,7 +81,8 @@ $(document).ready(function () {
8181 </div>` ;
8282 $ ( '.crtbody' ) . append ( createTableRow ( [ title , property ] , false , true ) ) ;
8383 createCP ( `cr_${ sColor [ key ] . key } ` , value , function ( rgb , hex , e ) {
84- requestAdjustment ( e . target . id . substr ( e . target . id . indexOf ( "_" ) + 1 ) , `[${ rgb . r } ,${ rgb . g } ,${ rgb . b } ]` ) ;
84+ const elementName = e . target . id . substr ( e . target . id . indexOf ( "_" ) + 1 ) ;
85+ requestAdjustment ( elementName , [ rgb . r , rgb . g , rgb . b ] ) ;
8586 } ) ;
8687 }
8788 // Handle boolean type adjustments
@@ -93,7 +94,8 @@ $(document).ready(function () {
9394 $ ( '.crtbody' ) . append ( createTableRow ( [ title , property ] , false , true ) ) ;
9495
9596 $ ( '#cr_' + sColor [ key ] . key ) . off ( ) . on ( 'change' , function ( e ) {
96- requestAdjustment ( e . target . id . substr ( e . target . id . indexOf ( "_" ) + 1 ) , e . currentTarget . checked ) ;
97+ const elementName = e . target . id . substr ( e . target . id . indexOf ( "_" ) + 1 ) ;
98+ requestAdjustment ( elementName , e . currentTarget . checked ) ;
9799 } ) ;
98100 }
99101 // Handle number type adjustments
@@ -110,8 +112,9 @@ $(document).ready(function () {
110112
111113 $ ( '.crtbody' ) . append ( createTableRow ( [ title , property ] , false , true ) ) ;
112114 $ ( '#cr_' + sColor [ key ] . key ) . off ( ) . on ( 'change' , function ( e ) {
113- valValue ( this . id , this . value , this . min , this . max ) ;
114- requestAdjustment ( e . target . id . substr ( e . target . id . indexOf ( "_" ) + 1 ) , e . currentTarget . value ) ;
115+ const elementName = e . target . id . substr ( e . target . id . indexOf ( "_" ) + 1 ) ;
116+ const value = valValue ( this . id , this . value , this . min , this . max ) ;
117+ requestAdjustment ( elementName , value ) ;
115118 } ) ;
116119 }
117120 }
0 commit comments