@@ -78,20 +78,20 @@ module Popup {
78
78
} else {
79
79
search ( id , tabStates ) ;
80
80
}
81
- } else if ( event . keyCode == 27 ) {
82
- Log . info ( "Esc pressed" ) ;
83
- setSearching ( id , false , tabStates ) ;
84
- Utils . sendCommand ( "clear" ) ;
85
81
}
86
82
}
87
83
88
- var queryInputInput = function ( ) {
89
- tabStates . set ( id , "query" , queryInput . value ) ;
90
-
84
+ function clear ( ) {
91
85
if ( tabStates . isSearching ( id ) ) {
92
86
setSearching ( id , false , tabStates ) ;
93
87
Utils . sendCommand ( "clear" ) ;
94
88
}
89
+ }
90
+
91
+ var queryInputInput = function ( ) {
92
+ tabStates . set ( id , "query" , queryInput . value ) ;
93
+
94
+ clear ( ) ;
95
95
96
96
// Remove the invalid class if it's there
97
97
queryInput . className = '' ;
@@ -103,10 +103,7 @@ module Popup {
103
103
Log . info ( "Set checkbox state to " + caseInsensitiveCheckbox . checked ) ;
104
104
tabStates . set ( id , "caseInsensitive" , caseInsensitiveCheckbox . checked ) ;
105
105
106
- if ( tabStates . isSearching ( id ) ) {
107
- setSearching ( id , false , tabStates ) ;
108
- Utils . sendCommand ( "clear" ) ;
109
- }
106
+ clear ( ) ;
110
107
}
111
108
112
109
prevButton . addEventListener ( "click" , prevButtonClick ) ;
0 commit comments