Merge pull request #1371 from kchadha/modal-by-vartype

Use variable type information in variable prompts to show/hide 'more options'
This commit is contained in:
kchadha authored and GitHub committed 2018-02-01 11:20:05 -05:00
commit c2ab92e20c
1 file changed
+5 -3
+5 -3
View File
@@ -235,10 +235,12 @@ class Blocks extends React.Component {
setBlocks (blocks) {
this.blocks = blocks;
}
handlePromptStart (message, defaultValue, callback, optTitle) {
handlePromptStart (message, defaultValue, callback, optTitle, optVarType) {
const p = {prompt: {callback, message, defaultValue}};
p.prompt.title = optTitle ? optTitle : 'New Variable';
p.prompt.showMoreOptions = optTitle !== 'New Message';
p.prompt.title = optTitle ? optTitle :
this.ScratchBlocks.VARIABLE_MODAL_TITLE;
p.prompt.showMoreOptions =
optVarType !== this.ScratchBlocks.BROADCAST_MESSAGE_VARIABLE_TYPE;
this.setState(p);
}
handlePromptCallback (data) {