Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add an enable() method to Typeahead #36

Merged
merged 1 commit into from

2 participants

@roddylindsay

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

@roddylindsay roddylindsay 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
4ee61c8
@epriestley epriestley merged commit 1006c35 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2012
  1. @roddylindsay

    add enable() method to Typeahead

    roddylindsay authored
    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
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/lib/control/typeahead/Typeahead.js
View
9 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;
Something went wrong with that request. Please try again.