mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
Cleanup: semicolons, spacing, etc. (#1116)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user