Fixed comment ownership. (#2923)

* Moved comment icons to use a model-based system. The block holds the model of the comment, and the comment icon holds a reference to it.
* Reorganized the setVisible function.
* Changed how xml.js serializes and deserializes comments.
This commit is contained in:
Beka Westberg
2019-09-20 13:16:07 -07:00
committed by Sam El-Husseini
parent 0726e4a909
commit 9e5df6216a
17 changed files with 890 additions and 219 deletions

View File

@@ -240,8 +240,9 @@ Blockly.PHP.scrub_ = function(block, code, opt_thisOnly) {
if (!block.outputConnection || !block.outputConnection.targetConnection) {
// Collect comment for this block.
var comment = block.getCommentText();
comment = Blockly.utils.string.wrap(comment, Blockly.PHP.COMMENT_WRAP - 3);
if (comment) {
comment = Blockly.utils.string.wrap(comment,
Blockly.PHP.COMMENT_WRAP - 3);
commentCode += Blockly.PHP.prefixLines(comment, '// ') + '\n';
}
// Collect comments for all value arguments.