Skip to content

Merge 06-22 #979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Blockly.Block = function(workspace, prototypeName, opt_id) {
/** @type {boolean|undefined} */
this.inputsInlineDefault = this.inputsInline;
if (Blockly.Events.isEnabled()) {
Blockly.Events.fire(new Blockly.Events.Create(this));
Blockly.Events.fire(new Blockly.Events.BlockCreate(this));
}
// Bind an onchange function, if it exists.
if (goog.isFunction(this.onchange)) {
Expand Down Expand Up @@ -235,7 +235,7 @@ Blockly.Block.prototype.dispose = function(healStack) {
}
this.unplug(healStack);
if (Blockly.Events.isEnabled()) {
Blockly.Events.fire(new Blockly.Events.Delete(this));
Blockly.Events.fire(new Blockly.Events.BlockDelete(this));
}
Blockly.Events.disable();

Expand Down Expand Up @@ -957,7 +957,7 @@ Blockly.Block.prototype.setOutput = function(newBoolean, opt_check) {
*/
Blockly.Block.prototype.setInputsInline = function(newBoolean) {
if (this.inputsInline != newBoolean) {
Blockly.Events.fire(new Blockly.Events.Change(
Blockly.Events.fire(new Blockly.Events.BlockChange(
this, 'inline', null, this.inputsInline, newBoolean));
this.inputsInline = newBoolean;
}
Expand Down Expand Up @@ -996,7 +996,7 @@ Blockly.Block.prototype.getInputsInline = function() {
*/
Blockly.Block.prototype.setDisabled = function(disabled) {
if (this.disabled != disabled) {
Blockly.Events.fire(new Blockly.Events.Change(
Blockly.Events.fire(new Blockly.Events.BlockChange(
this, 'disabled', null, this.disabled, disabled));
this.disabled = disabled;
}
Expand Down Expand Up @@ -1033,7 +1033,7 @@ Blockly.Block.prototype.isCollapsed = function() {
*/
Blockly.Block.prototype.setCollapsed = function(collapsed) {
if (this.collapsed_ != collapsed) {
Blockly.Events.fire(new Blockly.Events.Change(
Blockly.Events.fire(new Blockly.Events.BlockChange(
this, 'collapsed', null, this.collapsed_, collapsed));
this.collapsed_ = collapsed;
}
Expand Down Expand Up @@ -1629,7 +1629,7 @@ Blockly.Block.prototype.getCommentText = function() {
*/
Blockly.Block.prototype.setCommentText = function(text) {
if (this.comment != text) {
Blockly.Events.fire(new Blockly.Events.Change(
Blockly.Events.fire(new Blockly.Events.BlockChange(
this, 'comment', null, this.comment, text || ''));
this.comment = text;
}
Expand Down Expand Up @@ -1719,7 +1719,7 @@ Blockly.Block.prototype.getRelativeToSurfaceXY = function() {
*/
Blockly.Block.prototype.moveBy = function(dx, dy) {
goog.asserts.assert(!this.parentBlock_, 'Block has parent.');
var event = new Blockly.Events.Move(this);
var event = new Blockly.Events.BlockMove(this);
this.xy_.translate(dx, dy);
event.recordNew();
Blockly.Events.fire(event);
Expand Down
2 changes: 1 addition & 1 deletion core/block_dragger.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Blockly.BlockDragger.prototype.endBlockDrag = function(e, currentDragDeltaXY) {
* @private
*/
Blockly.BlockDragger.prototype.fireMoveEvent_ = function() {
var event = new Blockly.Events.Move(this.draggingBlock_);
var event = new Blockly.Events.BlockMove(this.draggingBlock_);
event.oldCoordinate = this.startXY_;
event.recordNew();
Blockly.Events.fire(event);
Expand Down
2 changes: 1 addition & 1 deletion core/block_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ Blockly.BlockSvg.prototype.moveBy = function(dx, dy) {
goog.asserts.assert(!this.parentBlock_, 'Block has parent.');
var eventsEnabled = Blockly.Events.isEnabled();
if (eventsEnabled) {
var event = new Blockly.Events.Move(this);
var event = new Blockly.Events.BlockMove(this);
}
var xy = this.getRelativeToSurfaceXY();
this.translate(xy.x + dx, xy.y + dy);
Expand Down
4 changes: 2 additions & 2 deletions core/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Blockly.Comment.prototype.createEditor_ = function() {
});
Blockly.bindEventWithChecks_(textarea, 'change', this, function(/* e */) {
if (this.text_ != textarea.value) {
Blockly.Events.fire(new Blockly.Events.Change(
Blockly.Events.fire(new Blockly.Events.BlockChange(
this.block_, 'comment', null, this.text_, textarea.value));
this.text_ = textarea.value;
}
Expand Down Expand Up @@ -259,7 +259,7 @@ Blockly.Comment.prototype.getText = function() {
*/
Blockly.Comment.prototype.setText = function(text) {
if (this.text_ != text) {
Blockly.Events.fire(new Blockly.Events.Change(
Blockly.Events.fire(new Blockly.Events.BlockChange(
this.block_, 'comment', null, this.text_, text));
this.text_ = text;
}
Expand Down
4 changes: 2 additions & 2 deletions core/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Blockly.Connection.prototype.connect_ = function(childConnection) {

var event;
if (Blockly.Events.isEnabled()) {
event = new Blockly.Events.Move(childBlock);
event = new Blockly.Events.BlockMove(childBlock);
}
// Establish the connections.
Blockly.Connection.connectReciprocally_(parentConnection, childConnection);
Expand Down Expand Up @@ -561,7 +561,7 @@ Blockly.Connection.prototype.disconnectInternal_ = function(parentBlock,
childBlock) {
var event;
if (Blockly.Events.isEnabled()) {
event = new Blockly.Events.Move(childBlock);
event = new Blockly.Events.BlockMove(childBlock);
}
var otherConnection = this.targetConnection;
otherConnection.targetConnection = null;
Expand Down
2 changes: 1 addition & 1 deletion core/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Blockly.ContextMenu.callbackFactory = function(block, xml) {
Blockly.Events.enable();
}
if (Blockly.Events.isEnabled() && !newBlock.isShadow()) {
Blockly.Events.fire(new Blockly.Events.Create(newBlock));
Blockly.Events.fire(new Blockly.Events.BlockCreate(newBlock));
}
newBlock.select();
};
Expand Down
Loading