B2G/gecko/browser/devtools/webconsole/webconsole.js
/*
   * Determine if an item should be hidden.
   *
   * @param nsIDOMElement aMenuItem
   * @param object aMetadata
   * @return boolean
   *         Whether the given item should be hidden or not.
   */
Determine if an item should be hidden.
@param nsIDOMElement aMenuItem
@param object aMetadata
@return boolean
Whether the given item should be hidden or not.
Determine if an item should be hidden . @param nsIDOMElement aMenuItem @param object aMetadata @return boolean Whether the given item should be hidden or not .
function CCM_shouldHideMenuItem(aMenuItem, aMetadata)
  {
    let selectionType = aMenuItem.getAttribute("selectiontype");
    if (selectionType && !aMetadata.selectionType == selectionType) {
      return true;
    }
    let selection = aMenuItem.getAttribute("selection");
    if (!selection) {
      return false;
    }
    let shouldHide = true;
    let itemData = selection.split("|");
    for (let type of aMetadata.selection) {
      if (itemData.indexOf(type) !== -1) {
        shouldHide = false;
        break;
      }
    }
    return shouldHide;
  }
function CCM_shouldHideMenuItem ( aMenuItem , aMetadata ) { let selectionType = aMenuItem . getAttribute ( "selectiontype" ) ; if ( selectionType && ! aMetadata . selectionType == selectionType ) { return true ; } let selection = aMenuItem . getAttribute ( "selection" ) ; if ( ! selection ) { return false ; } let shouldHide = true ; let itemData = selection . split ( "|" ) ; for ( let type of aMetadata . selection ) { if ( itemData . indexOf ( type ) !== - 1 ) { shouldHide = false ; break ; } } return shouldHide ; }
Determine if an item should be hidden.
Determine if an item should be hidden .
// check whether this menu item should show or not.