mirror of
https://github.com/google/blockly.git
synced 2026-01-07 17:10:11 +01:00
Refactoring Ui events in core (#4418)
* Ui events base (#4370) * Add constants for new ui event types * Add property to indicate an event as UI event * Click events (#4372) * Creating new ui base class. * Refactor theme event (#4391) * Add themeName property to theme event * Refactor marker move events. (#4389) * Refactor trashcan open event (#4392) * Refactor selected event (#4387) * Refactor toolbox item change event (#4394) * Refactor bubble open events (#4390) * Refactor block drag event (#4388) * Viewport events (#4395) * Fix event filtering for ui events (#4401) * Move events to new directory and rename Ui events base (#4400) * Move events to new directory and rename Ui events base * Add missing fromJson implementation for click event (#4410) * Adding serialization tests for events * Zoom controls event (#4407) * Refactor zoom event * Rename IS_UI_EVENT to isUiEvent
This commit is contained in:
@@ -20,8 +20,8 @@ goog.require('Blockly.constants');
|
||||
goog.require('Blockly.ContextMenu');
|
||||
goog.require('Blockly.ContextMenuRegistry');
|
||||
goog.require('Blockly.Events');
|
||||
goog.require('Blockly.Events.Ui');
|
||||
goog.require('Blockly.Events.BlockMove');
|
||||
goog.require('Blockly.Events.Selected');
|
||||
goog.require('Blockly.Msg');
|
||||
goog.require('Blockly.navigation');
|
||||
goog.require('Blockly.RenderedConnection');
|
||||
@@ -300,8 +300,7 @@ Blockly.BlockSvg.prototype.select = function() {
|
||||
Blockly.Events.enable();
|
||||
}
|
||||
}
|
||||
var event = new Blockly.Events.Ui(null, 'selected', oldId, this.id);
|
||||
event.workspaceId = this.workspace.id;
|
||||
var event = new Blockly.Events.Selected(oldId, this.id, this.workspace.id);
|
||||
Blockly.Events.fire(event);
|
||||
Blockly.selected = this;
|
||||
this.addSelect();
|
||||
@@ -314,7 +313,7 @@ Blockly.BlockSvg.prototype.unselect = function() {
|
||||
if (Blockly.selected != this) {
|
||||
return;
|
||||
}
|
||||
var event = new Blockly.Events.Ui(null, 'selected', this.id, null);
|
||||
var event = new Blockly.Events.Selected(this.id, null, this.workspace.id);
|
||||
event.workspaceId = this.workspace.id;
|
||||
Blockly.Events.fire(event);
|
||||
Blockly.selected = null;
|
||||
|
||||
Reference in New Issue
Block a user