Cleanup: semicolons, spacing, etc. (#1116)

This commit is contained in:
Rachel Fenichel
2017-05-19 16:27:48 -07:00
committed by GitHub
parent 63fe91180b
commit 104958e25f

View File

@@ -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);
}
}
};