Code cleanup addressing PR comments

This commit is contained in:
Karishma Chadha 2018-06-06 18:45:32 -04:00
parent 4843e35894
commit 2c2970df57
7 changed files with 73 additions and 19 deletions

View file

@ -337,8 +337,9 @@ Blockly.WorkspaceCommentSvg.prototype.resizeMouseUp_ = function(/*e*/) {
this.unbindDragEvents_();
var oldHW = this.resizeStartSize_;
this.resizeStartSize_ = null;
if (this.width_ == oldHW.width &&
this.height_ == oldHW.height) return;
if (this.width_ == oldHW.width && this.height_ == oldHW.height) {
return;
}
// Fire a change event for the new width/height after
// resize mouse up
Blockly.Events.fire(new Blockly.Events.CommentChange(
@ -365,7 +366,9 @@ Blockly.WorkspaceCommentSvg.prototype.resizeMouseMove_ = function(e) {
disabled = true;
}
this.setSize(this.RTL ? -newXY.x : newXY.x, newXY.y);
if (disabled) Blockly.Events.enable();
if (disabled) {
Blockly.Events.enable();
}
};
/**