Added a setOnClickHandler function to the image field.

This commit is contained in:
Beka Westberg
2019-07-19 09:17:09 -07:00
parent 674b2621ea
commit ed41b7f900

View File

@@ -189,4 +189,14 @@ Blockly.FieldImage.prototype.showEditor_ = function() {
}
};
/**
* Set the function that is called when this image is clicked.
* @param {function} func The function that is called when the image
* is clicked. It will receive the image field as a parameter.
* @public
*/
Blockly.FieldImage.prototype.setOnClickHandler = function(func) {
this.clickHandler_ = func;
};
Blockly.Field.register('field_image', Blockly.FieldImage);