Fix more compiler warnings

This commit is contained in:
Rachel Fenichel
2018-03-14 17:37:32 -07:00
parent 90a3730424
commit d4c3835a5e
3 changed files with 21 additions and 10 deletions

View File

@@ -36,7 +36,7 @@ goog.require('goog.asserts');
/**
* Class for a block dragger. It moves blocks around the workspace when they
* are being dragged by a mouse or touch.
* @param {!Blockly.Block} block The block to drag.
* @param {!Blockly.BlockSvg} block The block to drag.
* @param {!Blockly.WorkspaceSvg} workspace The workspace to drag on.
* @constructor
*/
@@ -168,10 +168,11 @@ Blockly.BlockDragger.prototype.startBlockDrag = function(currentDragDeltaXY) {
// surface.
this.draggingBlock_.moveToDragSurface_();
if (this.workspace_.toolbox_) {
var toolbox = this.workspace_.getToolbox();
if (toolbox) {
var style = this.draggingBlock_.isDeletable() ? 'blocklyToolboxDelete' :
'blocklyToolboxGrab';
this.workspace_.toolbox_.addStyle(style);
toolbox.addStyle(style);
}
};
@@ -226,10 +227,11 @@ Blockly.BlockDragger.prototype.endBlockDrag = function(e, currentDragDeltaXY) {
}
this.workspace_.setResizesEnabled(true);
if (this.workspace_.toolbox_) {
var toolbox = this.workspace_.getToolbox();
if (toolbox) {
var style = this.draggingBlock_.isDeletable() ? 'blocklyToolboxDelete' :
'blocklyToolboxGrab';
this.workspace_.toolbox_.removeStyle(style);
toolbox.removeStyle(style);
}
Blockly.Events.setGroup(false);
};