Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jsonDefinitionGenerator.forBlock['field_checkbox'] = function (
const code = {
type: 'field_checkbox',
name: block.getFieldValue('FIELDNAME'),
checked: block.getFieldValue('CHECKED'),
checked: block.getFieldValue('CHECKED') === 'TRUE',
};
return JSON.stringify(code);
};
Expand All @@ -40,7 +40,7 @@ javascriptDefinitionGenerator.forBlock['field_checkbox'] = function (
generator: JavascriptDefinitionGenerator,
): string {
const name = generator.quote_(block.getFieldValue('FIELDNAME'));
const checked = generator.quote_(block.getFieldValue('CHECKED'));
const checked = block.getFieldValue('CHECKED') === 'TRUE';
return `.appendField(new Blockly.FieldCheckbox(${checked}), ${name})`;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jsonDefinitionGenerator.forBlock['field_image'] = function (
width: block.getFieldValue('WIDTH'),
height: block.getFieldValue('HEIGHT'),
alt: block.getFieldValue('ALT'),
flipRtl: block.getFieldValue('FLIP_RTL'),
flipRtl: block.getFieldValue('FLIP_RTL') === 'TRUE',
};
return JSON.stringify(code);
};
Expand All @@ -46,7 +46,7 @@ javascriptDefinitionGenerator.forBlock['field_image'] = function (
const width = block.getFieldValue('WIDTH');
const height = block.getFieldValue('HEIGHT');
const alt = generator.quote_(block.getFieldValue('ALT'));
const flipRtl = generator.quote_(block.getFieldValue('FLIP_RTL'));
const flipRtl = block.getFieldValue('FLIP_RTL') === 'TRUE';

const code = `.appendField(new Blockly.FieldImage(${src}, ${width}, ${height}, { alt: ${alt}, flipRtl: ${flipRtl}}))`;
return code;
Expand Down
Loading