Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exec: async (list) => {
var preselect = list.selectedIndex || 0;
var {selected} = await list.world().filterableListPrompt(
"Select item", list.items,
{preselect, requester: list.getWindow() || list, itemPadding: Rectangle.inset(0,2), multiSelect: true});
if (selected.length) {
if (list.multiSelect) list.selections = selected;
else list.selection = selected[0];
list.scrollSelectionIntoView();
list.update();
}
return true;
}
},
build() {
this.submorphs = [
{
type: "text",
name: "html editor",
textString: this.target.html,
fontColor: Color.white,
fontFamily: "Monaco, monospace",
padding: Rectangle.inset(10, 10, 10, 2),
fontSize: 14,
fill: Color.transparent,
extent: this.extent,
clipMode: "auto"
}
];
}
build(props = {}) {
var {label} = props;
this.addMorph({
name: "label", type: "label", value: props.label,
fill: null, padding: Rectangle.inset(3), fontSize: 14, fontColor: Color.gray
});
this.addMorph({
name: "ok button", type: "button", label: "OK",
...this.okButtonStyle
});
connect(this.getSubmorphNamed("ok button"), 'fire', this, 'resolve');
this.initLayout();
}