Permalink
Browse files

add enable() method to Typeahead

Summary: adds an enable() method to Typeahead.  Use case is the following: I have a tokenizer and when a certain class of tokens is selected I want to disable the typeahead.  When those tokens are removed I want to re-enable the typeahead.

Test Plan: Implemented tokenizer with this behavior

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3617
  • Loading branch information...
1 parent f1de6ce commit 4ee61c88fb1be1a29117bc3ab50352e70811aa64 @roddylindsay roddylindsay committed Oct 4, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/lib/control/typeahead/Typeahead.js
@@ -325,6 +325,15 @@ JX.install('Typeahead', {
/**
* @task control
*/
+ enable : function() {
+ this._control.disabled = false;
+ this._stop = false;
+ },
+
+
+ /**
+ * @task control
+ */
disable : function() {
this._control.blur();
this._control.disabled = true;

0 comments on commit 4ee61c8

Please sign in to comment.