mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Make checks based on state, not conf.value
This commit is contained in:
parent
88792658aa
commit
32d8e93ddf
|
@ -23,7 +23,6 @@ export default function getInfoLi() {
|
||||||
|
|
||||||
.infoRow {
|
.infoRow {
|
||||||
position: relative;
|
position: relative;
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
}
|
||||||
.infoRow > input[type="checkbox"] {
|
.infoRow > input[type="checkbox"] {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -119,7 +118,7 @@ export default function getInfoLi() {
|
||||||
|
|
||||||
const iddy = props.idPrefix + ( props.ifDashify ? camelToDash(props.conf.key) : props.conf.key );
|
const iddy = props.idPrefix + ( props.ifDashify ? camelToDash(props.conf.key) : props.conf.key );
|
||||||
return (
|
return (
|
||||||
<li class={scopedCss.infoRow + ' horFlex'}>
|
<li class={scopedCss.infoRow + ' horFlex'} style={ props.children && 'flex-wrap: wrap'}>
|
||||||
<input
|
<input
|
||||||
type={props.type}
|
type={props.type}
|
||||||
name={props.name}
|
name={props.name}
|
||||||
|
|
|
@ -69,6 +69,7 @@ export default function getMain(theState) {
|
||||||
|
|
||||||
handleModChange({targetConf, targetIndex, newValue}) {
|
handleModChange({targetConf, targetIndex, newValue}) {
|
||||||
|
|
||||||
|
console.log('NEW VALUE', newValue);
|
||||||
const oldCats = this.state.catToOrderedMods;
|
const oldCats = this.state.catToOrderedMods;
|
||||||
const newCats = Object.keys(this.state.catToOrderedMods).reduce((acc, cat) => {
|
const newCats = Object.keys(this.state.catToOrderedMods).reduce((acc, cat) => {
|
||||||
|
|
||||||
|
|
|
@ -20,10 +20,10 @@ export default function getModList(theState) {
|
||||||
|
|
||||||
handleCheck(confMeta, ifChecked) {
|
handleCheck(confMeta, ifChecked) {
|
||||||
|
|
||||||
this.state.checks[confMeta.index] = ifChecked;
|
|
||||||
if (ifChecked === false || !confMeta.ifChild) {
|
if (ifChecked === false || !confMeta.ifChild) {
|
||||||
this.handleNewValue(confMeta, ifChecked);
|
this.handleNewValue(confMeta, ifChecked);
|
||||||
} else {
|
} else {
|
||||||
|
console.log('SET STATE', confMeta.index);
|
||||||
this.setState({
|
this.setState({
|
||||||
checks: this.state.checks.map(
|
checks: this.state.checks.map(
|
||||||
(ch, i) => i === confMeta.index ? ifChecked : ch
|
(ch, i) => i === confMeta.index ? ifChecked : ch
|
||||||
|
@ -63,7 +63,7 @@ export default function getModList(theState) {
|
||||||
conf={conf}
|
conf={conf}
|
||||||
type='checkbox'
|
type='checkbox'
|
||||||
name={props.name}
|
name={props.name}
|
||||||
checked={conf.value}
|
checked={this.state.checks[index]}
|
||||||
key={index}
|
key={index}
|
||||||
onChange={(event) => this.handleCheck(confMeta, event.target.checked)}
|
onChange={(event) => this.handleCheck(confMeta, event.target.checked)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -96,7 +96,7 @@ export default function getProxyEditor(theState) {
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
table.editor .export {
|
table.editor .export {
|
||||||
padding-right: 2px;
|
/*padding-right: 2px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LAST COLUMN: BUTTONS */
|
/* LAST COLUMN: BUTTONS */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user