SearchBox.prototype = {
__proto__: print_preview.Component.prototype,
- /** @param {string} query New query to set the search box's query to. */
+ /** @param {?string} query New query to set the search box's query to. */
setQuery: function(query) {
query = query || '';
this.input_.value = query.trim();
createDom: function() {
this.setElementInternal(this.cloneTemplateInternal(
'search-box-template'));
- this.input_ = this.getChildElement('.search-box-input');
+ this.input_ = assertInstanceof(this.getChildElement('.search-box-input'),
+ HTMLInputElement);
this.input_.setAttribute('placeholder', this.searchBoxPlaceholderText_);
},
/** @override */
enterDocument: function() {
print_preview.Component.prototype.enterDocument.call(this);
- this.tracker.add(this.input_, 'input', this.onInputInput_.bind(this));
+ this.tracker.add(assert(this.input_), 'input',
+ this.onInputInput_.bind(this));
},
/** @override */