mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-06-15 06:11:35 -04:00
Add back some checks
This commit is contained in:
parent
f1603e5785
commit
c5949a1bdd
2 changed files with 7 additions and 1 deletions
|
@ -42,6 +42,9 @@ goog.require('goog.math.Coordinate');
|
|||
* @constructor
|
||||
*/
|
||||
Blockly.Events.DragBlockOutside = function(block) {
|
||||
if (!block) {
|
||||
return; // Blank event to be populated by fromJson.
|
||||
}
|
||||
Blockly.Events.DragBlockOutside.superClass_.constructor.call(this, block);
|
||||
this.recordUndo = false;
|
||||
};
|
||||
|
@ -83,6 +86,9 @@ Blockly.Events.DragBlockOutside.prototype.fromJson = function(json) {
|
|||
* @constructor
|
||||
*/
|
||||
Blockly.Events.EndBlockDrag = function(block, isOutside) {
|
||||
if (!block) {
|
||||
return; // Blank event to be populated by fromJson.
|
||||
}
|
||||
Blockly.Events.EndBlockDrag.superClass_.constructor.call(this, block);
|
||||
this.isOutside = isOutside;
|
||||
// If drag ends outside the blocks workspace, send the block XML
|
||||
|
|
|
@ -48,7 +48,7 @@ goog.require('goog.math.Coordinate');
|
|||
Blockly.Events.Ui = function(block, element, oldValue, newValue) {
|
||||
Blockly.Events.Ui.superClass_.constructor.call(this);
|
||||
this.blockId = block ? block.id : null;
|
||||
this.workspaceId = block? block.workspace.id : null;
|
||||
this.workspaceId = block ? block.workspace.id : null;
|
||||
this.element = element;
|
||||
this.oldValue = oldValue;
|
||||
this.newValue = newValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue