Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
b36a88f4
Commit
b36a88f4
authored
Feb 10, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bad rendering of collapsed function calls.
parent
d05177e1
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
23 deletions
+34
-23
blocks/procedures.js
blocks/procedures.js
+25
-14
blocks_compressed.js
blocks_compressed.js
+9
-9
No files found.
blocks/procedures.js
View file @
b36a88f4
...
...
@@ -273,7 +273,7 @@ Blockly.Blocks['procedures_defnoreturn'] = {
if
(
change
)
{
this
.
updateParams_
();
// Update the mutator's variables if the mutator is open.
if
(
this
.
mutator
.
isVisible
_
())
{
if
(
this
.
mutator
.
isVisible
())
{
var
blocks
=
this
.
mutator
.
workspace_
.
getAllBlocks
();
for
(
var
i
=
0
,
block
;
block
=
blocks
[
i
];
i
++
)
{
if
(
block
.
type
==
'
procedures_mutatorarg
'
&&
...
...
@@ -428,10 +428,9 @@ Blockly.Blocks['procedures_callnoreturn'] = {
init
:
function
()
{
this
.
setHelpUrl
(
Blockly
.
Msg
.
PROCEDURES_CALLNORETURN_HELPURL
);
this
.
setColour
(
Blockly
.
Blocks
.
procedures
.
HUE
);
this
.
appendDummyInput
()
this
.
appendDummyInput
(
'
TOPROW
'
)
.
appendField
(
Blockly
.
Msg
.
PROCEDURES_CALLNORETURN_CALL
)
.
appendField
(
''
,
'
NAME
'
)
.
appendField
(
Blockly
.
Msg
.
PROCEDURES_CALL_BEFORE_PARAMS
,
'
WITH
'
);
.
appendField
(
''
,
'
NAME
'
);
this
.
setPreviousStatement
(
true
);
this
.
setNextStatement
(
true
);
// Tooltip is set in domToMutation.
...
...
@@ -488,6 +487,12 @@ Blockly.Blocks['procedures_callnoreturn'] = {
this
.
quarkArguments_
=
null
;
return
;
}
if
(
goog
.
array
.
equals
(
this
.
arguments_
,
paramNames
))
{
// No change.
this
.
quarkArguments_
=
paramIds
;
return
;
}
this
.
setCollapsed
(
false
);
if
(
paramIds
.
length
!=
paramNames
.
length
)
{
throw
'
Error: paramNames and paramIds must be the same length.
'
;
}
...
...
@@ -536,14 +541,21 @@ Blockly.Blocks['procedures_callnoreturn'] = {
}
}
}
if
(
savedRendered
)
{
input
.
init
();
}
}
// Add 'with:' if there are parameters.
var
withField
=
this
.
getField_
(
'
WITH
'
);
if
(
withField
)
{
withField
.
setVisible
(
!!
this
.
arguments_
.
length
);
var
input
=
this
.
getInput
(
'
TOPROW
'
);
if
(
input
)
{
if
(
this
.
arguments_
.
length
)
{
if
(
!
this
.
getField_
(
'
WITH
'
))
{
input
.
appendField
(
Blockly
.
Msg
.
PROCEDURES_CALL_BEFORE_PARAMS
,
'
WITH
'
);
input
.
init
();
}
}
else
{
if
(
this
.
getField_
(
'
WITH
'
))
{
input
.
removeField
(
'
WITH
'
);
}
}
}
// Restore rendering and show the changes.
this
.
rendered
=
savedRendered
;
...
...
@@ -578,7 +590,7 @@ Blockly.Blocks['procedures_callnoreturn'] = {
(
this
.
outputConnection
?
Blockly
.
Msg
.
PROCEDURES_CALLRETURN_TOOLTIP
:
Blockly
.
Msg
.
PROCEDURES_CALLNORETURN_TOOLTIP
).
replace
(
'
%1
'
,
name
));
var
def
=
Blockly
.
Procedures
.
getDefinition
(
name
,
this
.
workspace
);
if
(
def
&&
def
.
mutator
.
isVisible
())
{
if
(
def
&&
def
.
mutator
&&
def
.
mutator
.
isVisible
())
{
// Initialize caller with the mutator's IDs.
this
.
setProcedureParameters
(
def
.
arguments_
,
def
.
paramIds_
);
}
else
{
...
...
@@ -634,10 +646,9 @@ Blockly.Blocks['procedures_callreturn'] = {
init
:
function
()
{
this
.
setHelpUrl
(
Blockly
.
Msg
.
PROCEDURES_CALLRETURN_HELPURL
);
this
.
setColour
(
Blockly
.
Blocks
.
procedures
.
HUE
);
this
.
appendDummyInput
()
this
.
appendDummyInput
(
'
TOPROW
'
)
.
appendField
(
Blockly
.
Msg
.
PROCEDURES_CALLRETURN_CALL
)
.
appendField
(
''
,
'
NAME
'
)
.
appendField
(
Blockly
.
Msg
.
PROCEDURES_CALL_BEFORE_PARAMS
,
'
WITH
'
);
.
appendField
(
''
,
'
NAME
'
);
this
.
setOutput
(
true
);
// Tooltip is set in domToMutation.
this
.
arguments_
=
[];
...
...
blocks_compressed.js
View file @
b36a88f4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment