+ /**
+ * Check if the widget is read-only.
+ *
+ * @return {boolean}
+ */
+ mw.widgets.TitleSearchWidget.prototype.isReadOnly = function () {
+ return this.query.isReadOnly();
+ };
+
+ /**
+ * Set the read-only state of the widget.
+ *
+ * @param {boolean} readOnly Make input read-only
+ * @chainable
+ * @return {mw.widgets.TitleSearchWidget} The widget, for chaining
+ */
+ mw.widgets.TitleSearchWidget.prototype.setReadOnly = function ( readOnly ) {
+ this.query.setReadOnly( readOnly );
+ if ( readOnly ) {
+ // Hide results
+ this.results.clearItems();
+ }
+ return this;
+ };
+
+}() );