mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2026-01-27 06:04:30 +01:00
Make em toggle affect existing results
This commit is contained in:
@@ -5,26 +5,23 @@ import BitwiseResultViewModel from './BitwiseResultViewModel';
|
||||
import { Expression, ExpressionToken } from '../expression-interfaces';
|
||||
import { OperatorToken, ScalarToken } from '../expression';
|
||||
|
||||
type BitwiseOperationExpressionViewProps = {
|
||||
type BitwiseResultViewProps = {
|
||||
expression: Expression;
|
||||
emphasizeBytes: boolean;
|
||||
}
|
||||
|
||||
type BitwiseOperationExpressionViewState = {
|
||||
type BitwiseResultViewState = {
|
||||
|
||||
}
|
||||
|
||||
export default class BitwiseResultView extends React.Component<BitwiseOperationExpressionViewProps, BitwiseOperationExpressionViewState> {
|
||||
constructor(props: BitwiseOperationExpressionViewProps) {
|
||||
export default class BitwiseResultView extends React.Component<BitwiseResultViewProps, BitwiseResultViewState> {
|
||||
constructor(props: BitwiseResultViewProps) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
render() {
|
||||
var rows = this.getRows();
|
||||
if(!rows) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return <table className="expression">
|
||||
<tbody>
|
||||
{rows}
|
||||
@@ -32,7 +29,7 @@ export default class BitwiseResultView extends React.Component<BitwiseOperationE
|
||||
</table>
|
||||
}
|
||||
|
||||
getRows() : JSX.Element[] | null {
|
||||
getRows() : JSX.Element[] {
|
||||
var model = BitwiseResultViewModel.createModel(this.props.expression, this.props.emphasizeBytes);
|
||||
|
||||
return model.items.map((itm, i) =>
|
||||
|
||||
@@ -12,7 +12,7 @@ const expressionAppModule = {
|
||||
canHandle: (input:string) => parser.canParse(input),
|
||||
handle: function(c: CommandInput) {
|
||||
var expr = parser.parse(c.input);
|
||||
appState.addCommandResult(c.input, <BitwiseResultView expression={expr!} emphasizeBytes={appState.emphasizeBytes} />);
|
||||
appState.addCommandResult(c.input, () => <BitwiseResultView expression={expr!} emphasizeBytes={appState.emphasizeBytes} />);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user