Merge pull request #151 from AllisonLamm/master

adding type annotations
This commit is contained in:
Neil Fraser
2015-08-10 12:27:12 -07:00
2 changed files with 3 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ Blockly.Css.inject = function(hasCss, pathToMedia) {
/**
* Set the cursor to be displayed when over something draggable.
* @param {Blockly.Cursor} cursor Enum.
* @param {Blockly.Css.Cursor} cursor Enum.
*/
Blockly.Css.setCursor = function(cursor) {
if (Blockly.Css.currentCursor_ == cursor) {

View File

@@ -126,6 +126,7 @@ Blockly.FieldTextInput.prototype.showEditor_ = function(opt_quietInput) {
// Create the input.
var htmlInput = goog.dom.createDom('input', 'blocklyHtmlInput');
htmlInput.setAttribute('spellcheck', this.spellcheck_);
/** @type {!HTMLInputElement} */
Blockly.FieldTextInput.htmlInput_ = htmlInput;
div.appendChild(htmlInput);
@@ -200,7 +201,7 @@ Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(e) {
Blockly.FieldTextInput.prototype.validate_ = function() {
var valid = true;
goog.asserts.assertObject(Blockly.FieldTextInput.htmlInput_);
var htmlInput = /** @type {!Element} */ (Blockly.FieldTextInput.htmlInput_);
var htmlInput = Blockly.FieldTextInput.htmlInput_;
if (this.sourceBlock_ && this.changeHandler_) {
valid = this.changeHandler_(htmlInput.value);
}