diff --git a/core/field_image.js b/core/field_image.js index e5177e63e..ede3e2b92 100644 --- a/core/field_image.js +++ b/core/field_image.js @@ -38,11 +38,11 @@ goog.require('goog.userAgent'); * @param {number} width Width of the image. * @param {number} height Height of the image. * @param {string=} opt_alt Optional alt text for when block is collapsed. - * @param {function=} opt_onclick Optional function to be called when image is clicked + * @param {function=} opt_onClick Optional function to be called when image is clicked * @extends {Blockly.Field} * @constructor */ -Blockly.FieldImage = function(src, width, height, opt_alt, opt_onclick) { +Blockly.FieldImage = function(src, width, height, opt_alt, opt_onClick) { this.sourceBlock_ = null; // Ensure height and width are numbers. Strings are bad at math. @@ -53,10 +53,9 @@ Blockly.FieldImage = function(src, width, height, opt_alt, opt_onclick) { this.text_ = opt_alt || ''; this.setValue(src); - if(typeof opt_onclick === "function"){ - this.clickHandler_ = opt_onclick; + if (typeof opt_onClick === "function") { + this.clickHandler_ = opt_onClick; } - }; goog.inherits(Blockly.FieldImage, Blockly.Field); @@ -171,10 +170,9 @@ Blockly.FieldImage.prototype.updateWidth = function() { /** * If field click is called, and click handler defined, * call the handler. - * @private */ - Blockly.FieldImage.prototype.showEditor = function(){ - if(typeof this.clickHandler_ === "function"){ + Blockly.FieldImage.prototype.showEditor = function() { + if (this.clickHandler_){ this.clickHandler_(this); } - } + };