B2G/gecko/browser/components/places/content/places.js
/**
   * Set up the content of the view menu.
   */
Set up the content of the view menu.
Set up the content of the view menu .
function VM_populateSortMenu(event) {
    this.fillWithColumns(event, "viewUnsorted", "directionSeparator", "radio", "view.sortBy.");
    var sortColumn = this._getSortColumn();
    var viewSortAscending = document.getElementById("viewSortAscending");
    var viewSortDescending = document.getElementById("viewSortDescending");
    var viewUnsorted = document.getElementById("viewUnsorted");
    if (!sortColumn) {
      viewSortAscending.removeAttribute("checked");
      viewSortDescending.removeAttribute("checked");
      viewUnsorted.setAttribute("checked", "true");
    }
    else if (sortColumn.getAttribute("sortDirection") == "ascending") {
      viewSortAscending.setAttribute("checked", "true");
      viewSortDescending.removeAttribute("checked");
      viewUnsorted.removeAttribute("checked");
    }
    else if (sortColumn.getAttribute("sortDirection") == "descending") {
      viewSortDescending.setAttribute("checked", "true");
      viewSortAscending.removeAttribute("checked");
      viewUnsorted.removeAttribute("checked");
    }
  }
function VM_populateSortMenu ( event ) { this . fillWithColumns ( event , "viewUnsorted" , "directionSeparator" , "radio" , "view.sortBy." ) ; var sortColumn = this . _getSortColumn ( ) ; var viewSortAscending = document . getElementById ( "viewSortAscending" ) ; var viewSortDescending = document . getElementById ( "viewSortDescending" ) ; var viewUnsorted = document . getElementById ( "viewUnsorted" ) ; if ( ! sortColumn ) { viewSortAscending . removeAttribute ( "checked" ) ; viewSortDescending . removeAttribute ( "checked" ) ; viewUnsorted . setAttribute ( "checked" , "true" ) ; } else if ( sortColumn . getAttribute ( "sortDirection" ) == "ascending" ) { viewSortAscending . setAttribute ( "checked" , "true" ) ; viewSortDescending . removeAttribute ( "checked" ) ; viewUnsorted . removeAttribute ( "checked" ) ; } else if ( sortColumn . getAttribute ( "sortDirection" ) == "descending" ) { viewSortDescending . setAttribute ( "checked" , "true" ) ; viewSortAscending . removeAttribute ( "checked" ) ; viewUnsorted . removeAttribute ( "checked" ) ; } }
Set up the content of the view menu.
Set up the content of the view menu .
// We need to remove an existing checked attribute because the unsorted // menu item is not rebuilt every time we open the menu like the others.