mirror of
https://github.com/google/blockly.git
synced 2026-03-11 15:50:10 +01:00
Added a setOnClickHandler function to the image field.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user