Skip to content

Commit

Permalink
Add determineUpdates toggle #57
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbingwide committed Sep 27, 2022
1 parent 30a2377 commit 1303f59
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/oik-blocklist/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
"type": "boolean",
"default": false
},
"determineUpdates": {
"type": "boolean",
"default": false
},
"component": {
"type": "string",
"default": ""
Expand Down
3 changes: 3 additions & 0 deletions src/oik-blocklist/blocklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ function BlockNoLink( block, component ) {
*/
function BlockDescription( description ) {
//console.log( description );
if ( undefined === description ) {
return( '' );
}
if ( typeof description === 'boolean') {
return( '' );
}
Expand Down
15 changes: 14 additions & 1 deletion src/oik-blocklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export default registerBlockType(
props.setAttributes( { showBatch: ! props.attributes.showBatch } );
}

const onChangeDetermineUpdates = ( event ) => {
props.setAttributes( { determineUpdates: ! props.attributes.determineUpdates } );
}
const onChangeComponent = ( event ) => {
props.setAttributes( { component: event } );
}
Expand Down Expand Up @@ -133,8 +136,18 @@ export default registerBlockType(
/>

</PanelRow>
<PanelRow>
<ToggleControl
label={ __( 'Determine updates to apply', 'oik-blocks' ) }
checked={ !! props.attributes.determineUpdates }
onChange={ onChangeDetermineUpdates }

/>

<PanelRow>
</PanelRow>


<PanelRow>
<TextControl label={__( "Component", 'oik-blocks' )} value={ props.attributes.component} onChange={ onChangeComponent }/>
</PanelRow>

Expand Down

0 comments on commit 1303f59

Please sign in to comment.