Skip to content

Commit

Permalink
Merge pull request #133 from wordpress-mobile/feature/heading_toolbar
Browse files Browse the repository at this point in the history
Heading toolbar
  • Loading branch information
SergioEstevao authored Sep 8, 2018
2 parents 80863d7 + ec457af commit fb6d1f3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 184 files
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
'node',
],
moduleNameMapper: {
'@wordpress\\/(blocks|data|element|deprecated|editor|redux-routine|block-library|components|keycodes|url|a11y)$': '<rootDir>/gutenberg/packages/$1/src/index',
'@wordpress\\/(blocks|data|element|deprecated|editor|redux-routine|block-library|components|keycodes|url|a11y|viewport|core-data|api-fetch|nux)$': '<rootDir>/gutenberg/packages/$1/src/index',

// Mock the CSS modules. See https://facebook.github.io/jest/docs/en/webpack.html#handling-static-assets
'\\.(scss)$': '<rootDir>/__mocks__/styleMock.js',
Expand Down
1 change: 0 additions & 1 deletion src/block-management/block-holder.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export default class BlockHolder extends React.Component<PropsType, StateType> {
style = styles.blockText;
}

// TODO: setAttributes needs to change the state/attributes
return (
<Block
attributes={ { ...this.props.attributes } }
Expand Down
7 changes: 4 additions & 3 deletions src/block-management/block-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,15 @@ export default class BlockManager extends React.Component<PropsType, StateType>
}

onChange( clientId: string, attributes: mixed ) {
// Update datasource UI
// Update Redux store
this.props.onChange( clientId, attributes );

// Change the data source
const index = this.getDataSourceIndexFromClientId( clientId );
const dataSource = this.state.dataSource;
const block = dataSource.get( index );
block.attributes = attributes;
dataSource.set( index, block );
// Update Redux store
this.props.onChange( clientId, attributes );
}

renderList() {
Expand Down

0 comments on commit fb6d1f3

Please sign in to comment.