B2G/gecko/browser/components/tabview/search.js
// Handles all keydown while search mode.
Handles all keydown while search mode.
Handles all keydown while search mode .
function Search__inSearchKeyHandler(event) {
    let term = iQ("#searchbox").val();
    if ((event.keyCode == event.DOM_VK_ESCAPE) ||
        (event.keyCode == event.DOM_VK_BACK_SPACE && term.length <= 1 &&
         this._initiatedBy == "keydown")) {
      this.hide(event);
      return;
    }
    let matcher = this.createSearchTabMatcher();
    let matches = matcher.matched();
    let others =  matcher.matchedTabsFromOtherWindows();
    if ((event.keyCode == event.DOM_VK_RETURN ||
         event.keyCode == event.DOM_VK_ENTER) &&
         (matches.length > 0 || others.length > 0)) {
      this.hide(event);
      if (matches.length > 0) 
        matches[0].zoomIn();
      else
        TabUtils.focus(others[0]);
    }
  }
function Search__inSearchKeyHandler ( event ) { let term = iQ ( "#searchbox" ) . val ( ) ; if ( ( event . keyCode == event . DOM_VK_ESCAPE ) || ( event . keyCode == event . DOM_VK_BACK_SPACE && term . length <= 1 && this . _initiatedBy == "keydown" ) ) { this . hide ( event ) ; return ; } let matcher = this . createSearchTabMatcher ( ) ; let matches = matcher . matched ( ) ; let others = matcher . matchedTabsFromOtherWindows ( ) ; if ( ( event . keyCode == event . DOM_VK_RETURN || event . keyCode == event . DOM_VK_ENTER ) && ( matches . length > 0 || others . length > 0 ) ) { this . hide ( event ) ; if ( matches . length > 0 ) matches [ 0 ] . zoomIn ( ) ; else TabUtils . focus ( others [ 0 ] ) ; } }
Handles all keydown while search mode.
Handles all keydown while search mode .