mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Merge pull request #3426 from rachel-fenichel/highlight_for_replacement
Move highlightForReplacement into the path object as well.
This commit is contained in:
@@ -1756,11 +1756,5 @@ Blockly.BlockSvg.prototype.getHeightWidth = function() {
|
||||
* @package
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.highlightForReplacement = function(add) {
|
||||
if (add) {
|
||||
Blockly.utils.dom.addClass(/** @type {!Element} */ (this.svgGroup_),
|
||||
'blocklyReplaceable');
|
||||
} else {
|
||||
Blockly.utils.dom.removeClass(/** @type {!Element} */ (this.svgGroup_),
|
||||
'blocklyReplaceable');
|
||||
}
|
||||
this.pathObject.updateReplacementHighlight(add);
|
||||
};
|
||||
|
||||
@@ -111,3 +111,12 @@ Blockly.blockRendering.IPathObject.prototype.updateInsertionMarker;
|
||||
* @package
|
||||
*/
|
||||
Blockly.blockRendering.IPathObject.prototype.updateMovable;
|
||||
|
||||
/**
|
||||
* Add or remove styling that shows that if the dragging block is dropped, this
|
||||
* block will be replaced. If a shadow block, it will disappear. Otherwise it
|
||||
* will bump.
|
||||
* @param {boolean} enable True if styling should be added.
|
||||
* @package
|
||||
*/
|
||||
Blockly.blockRendering.IPathObject.prototype.updateReplacementHighlight;
|
||||
|
||||
@@ -221,3 +221,15 @@ Blockly.blockRendering.PathObject.prototype.updateMovable = function(enable) {
|
||||
this.setClass_('blocklyDraggable', enable);
|
||||
};
|
||||
|
||||
/**
|
||||
* Add or remove styling that shows that if the dragging block is dropped, this
|
||||
* block will be replaced. If a shadow block, it will disappear. Otherwise it
|
||||
* will bump.
|
||||
* @param {boolean} enable True if styling should be added.
|
||||
* @package
|
||||
*/
|
||||
Blockly.blockRendering.PathObject.prototype.updateReplacementHighlight =
|
||||
function(enable) {
|
||||
/* eslint-disable indent */
|
||||
this.setClass_('blocklyReplaceable', enable);
|
||||
}; /* eslint-enable indent */
|
||||
|
||||
Reference in New Issue
Block a user