B2G/gecko/browser/devtools/styleinspector/CssRuleView.jsm
/**
   * Update the rule view's context menu by disabling irrelevant menuitems and
   * enabling relevant ones.
   *
   * @param aEvent The event object
   */
Update the rule view's context menu by disabling irrelevant menuitems and
enabling relevant ones.

@param aEvent The event object
Update the rule view ' s context menu by disabling irrelevant menuitems and enabling relevant ones . @param aEvent The event object
function CssRuleView_onMenuUpdate(aEvent)
  {
    let disable = this.doc.defaultView.getSelection().isCollapsed;
    this._copyItem.disabled = disable;
    let node = this.doc.popupNode;
    if (!node) {
      return;
    }
    if (!node.classList.contains("ruleview-property") &&
        !node.classList.contains("ruleview-computed")) {
      while (node = node.parentElement) {
        if (node.classList.contains("ruleview-property") ||
          node.classList.contains("ruleview-computed")) {
          break;
        }
      }
    }
    let disablePropertyItems = !node || (node &&
      !node.classList.contains("ruleview-property") &&
      !node.classList.contains("ruleview-computed"));
    this._declarationItem.disabled = disablePropertyItems;
    this._propertyItem.disabled = disablePropertyItems;
    this._propertyValueItem.disabled = disablePropertyItems;
  }
function CssRuleView_onMenuUpdate ( aEvent ) { let disable = this . doc . defaultView . getSelection ( ) . isCollapsed ; this . _copyItem . disabled = disable ; let node = this . doc . popupNode ; if ( ! node ) { return ; } if ( ! node . classList . contains ( "ruleview-property" ) && ! node . classList . contains ( "ruleview-computed" ) ) { while ( node = node . parentElement ) { if ( node . classList . contains ( "ruleview-property" ) || node . classList . contains ( "ruleview-computed" ) ) { break ; } } } let disablePropertyItems = ! node || ( node && ! node . classList . contains ( "ruleview-property" ) && ! node . classList . contains ( "ruleview-computed" ) ) ; this . _declarationItem . disabled = disablePropertyItems ; this . _propertyItem . disabled = disablePropertyItems ; this . _propertyValueItem . disabled = disablePropertyItems ; }
Update the rule view's context menu by disabling irrelevant menuitems and
 enabling relevant ones.
Update the rule view ' s context menu by disabling irrelevant menuitems and enabling relevant ones .
// Copy selection. // Copy property, copy property name & copy property value.