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
ca9ee114
Commit
ca9ee114
authored
Aug 28, 2015
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'id' from XML unless realtime is enabled.
parent
8aa8bbb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
core/xml.js
core/xml.js
+6
-2
No files found.
core/xml.js
View file @
ca9ee114
...
...
@@ -62,7 +62,10 @@ Blockly.Xml.workspaceToDom = function(workspace) {
Blockly
.
Xml
.
blockToDom_
=
function
(
block
)
{
var
element
=
goog
.
dom
.
createDom
(
'
block
'
);
element
.
setAttribute
(
'
type
'
,
block
.
type
);
element
.
setAttribute
(
'
id
'
,
block
.
id
);
if
(
Blockly
.
Realtime
.
isEnabled
())
{
// Only used by realtime.
element
.
setAttribute
(
'
id
'
,
block
.
id
);
}
if
(
block
.
mutationToDom
)
{
// Custom data for an advanced block.
var
mutation
=
block
.
mutationToDom
();
...
...
@@ -297,6 +300,7 @@ Blockly.Xml.domToBlockHeadless_ =
}
var
id
=
xmlBlock
.
getAttribute
(
'
id
'
);
if
(
opt_reuseBlock
&&
id
)
{
// Only used by realtime.
block
=
Blockly
.
Block
.
getById
(
id
,
workspace
);
// TODO: The following is for debugging. It should never actually happen.
if
(
!
block
)
{
...
...
@@ -441,7 +445,7 @@ Blockly.Xml.domToBlockHeadless_ =
}
// Give the block a chance to clean up any initial inputs.
if
(
block
.
validate
)
{
block
.
validate
.
call
(
block
);
block
.
validate
(
);
}
return
block
;
};
...
...
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