Skip to content

Commit bd8a052

Browse files
authored
editor tweaks -- hide expandable button size when 0
1 parent bbc6bc8 commit bd8a052

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/addons/addons/editor-tweaks/userscript.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ export default async function({ addon }) {
217217
if (this.fieldGroup_) return;
218218
Blockly.FieldExpandableAdd.superClass_.init.call(this);
219219

220+
if (expandBtnSz === 0 && this.sourceBlock_) {
221+
const input = this.sourceBlock_.inputList.find(i => i.fieldRow.includes(this));
222+
if (input) input.setVisible(false);
223+
}
224+
220225
const ratio = (Blockly.BlockSvg.FIELD_HEIGHT / 32) * expandBtnSz;
221226
this.size_.width = Blockly.BlockSvg.FIELD_HEIGHT * expandBtnSz;
222227
this.size_.height *= expandBtnSz;

0 commit comments

Comments
 (0)