B2G/gecko/browser/components/places/content/places.js
/**
   * Sets the search scope based on aNode's properties.
   * @param   aNode
   *          the node to set up scope from
   */
Sets the search scope based on aNode's properties.
@param   aNode
the node to set up scope from
Sets the search scope based on aNode ' s properties . @param aNode the node to set up scope from
function PO__setScopeForNode(aNode) {
    let itemId = aNode.itemId;
    let bookmarksButton = document.getElementById("scopeBarAll");
    bookmarksButton.hidden = false;
    let downloadsButton = document.getElementById("scopeBarDownloads");
    downloadsButton.hidden = true;
    if (PlacesUtils.nodeIsHistoryContainer(aNode) ||
        itemId == PlacesUIUtils.leftPaneQueries["History"]) {
      PlacesQueryBuilder.setScope("history");
    }
    else if (itemId == PlacesUIUtils.leftPaneQueries["Downloads"]) {
      downloadsButton.hidden = false;
      bookmarksButton.hidden = true;
      PlacesQueryBuilder.setScope("downloads");
    }
    else {
      PlacesQueryBuilder.setScope("bookmarks");
    }
    let folderButton = document.getElementById("scopeBarFolder");
    folderButton.hidden = !PlacesUtils.nodeIsFolder(aNode) ||
                          itemId == PlacesUIUtils.allBookmarksFolderId;
  }
function PO__setScopeForNode ( aNode ) { let itemId = aNode . itemId ; let bookmarksButton = document . getElementById ( "scopeBarAll" ) ; bookmarksButton . hidden = false ; let downloadsButton = document . getElementById ( "scopeBarDownloads" ) ; downloadsButton . hidden = true ; if ( PlacesUtils . nodeIsHistoryContainer ( aNode ) || itemId == PlacesUIUtils . leftPaneQueries [ "History" ] ) { PlacesQueryBuilder . setScope ( "history" ) ; } else if ( itemId == PlacesUIUtils . leftPaneQueries [ "Downloads" ] ) { downloadsButton . hidden = false ; bookmarksButton . hidden = true ; PlacesQueryBuilder . setScope ( "downloads" ) ; } else { PlacesQueryBuilder . setScope ( "bookmarks" ) ; } let folderButton = document . getElementById ( "scopeBarFolder" ) ; folderButton . hidden = ! PlacesUtils . nodeIsFolder ( aNode ) || itemId == PlacesUIUtils . allBookmarksFolderId ; }
Sets the search scope based on aNode's properties.
Sets the search scope based on aNode ' s properties .
// Set default buttons status. // Default to All Bookmarks for all other nodes, per bug 469437. // Enable or disable the folder scope button.