mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
Make finished-loading events be UI events
This commit is contained in:
@@ -390,6 +390,9 @@ Blockly.Events.fromJson = function(json, workspace) {
|
||||
case Blockly.Events.COMMENT_DELETE:
|
||||
event = new Blockly.Events.CommentDelete(null);
|
||||
break;
|
||||
case Blockly.Events.FINISHED_LOADING:
|
||||
event = new Blockly.Events.FinishedLoading(null);
|
||||
break;
|
||||
default:
|
||||
throw Error('Unknown event type.');
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
goog.provide('Blockly.Events.FinishedLoading');
|
||||
|
||||
goog.require('Blockly.Events');
|
||||
goog.require('Blockly.Events.Abstract');
|
||||
goog.require('Blockly.Events.Ui');
|
||||
goog.require('Blockly.utils.object');
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ Blockly.Events.FinishedLoading = function(workspace) {
|
||||
this.workspaceId = workspace.id;
|
||||
|
||||
/**
|
||||
* The event group id for the group this event belongs to. Groups define
|
||||
* The event group ID for the group this event belongs to. Groups define
|
||||
* events that should be treated as an single action from the user's
|
||||
* perspective, and should be undone together.
|
||||
* @type {string}
|
||||
@@ -57,7 +57,7 @@ Blockly.Events.FinishedLoading = function(workspace) {
|
||||
this.recordUndo = false;
|
||||
};
|
||||
Blockly.utils.object.inherits(Blockly.Events.FinishedLoading,
|
||||
Blockly.Events.Abstract);
|
||||
Blockly.Events.Ui);
|
||||
|
||||
/**
|
||||
* Type of this event.
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
primaryWorkspace.addChangeListener(mirrorEvent);
|
||||
|
||||
function mirrorEvent(primaryEvent) {
|
||||
if (primaryEvent.type == Blockly.Events.UI) {
|
||||
if (primaryEvent instanceof Blockly.Events.Ui) {
|
||||
return; // Don't mirror UI events.
|
||||
}
|
||||
// Convert event to JSON. This could then be transmitted across the net.
|
||||
|
||||
Reference in New Issue
Block a user