Changeset 185709 in webkit


Ignore:
Timestamp:
Jun 18, 2015, 10:58:33 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: New Rule button doesn't reveal the newly added rule if not visible upon creation
https://bugs.webkit.org/show_bug.cgi?id=117600

Patch by Devin Rousso <Devin Rousso> on 2015-06-18
Reviewed by Timothy Hatcher.

  • UserInterface/Views/RulesStyleDetailsPanel.js: Made previousFocusedSection into a member variable of the RulesStyleDetailsPanel. This way, when the nodeStyles is refreshed (when a new rule is added), the previousFocusedSection will be scrolled into view.

(WebInspector.RulesStyleDetailsPanel):
(WebInspector.RulesStyleDetailsPanel.prototype.refresh.appendStyleSection):
(WebInspector.RulesStyleDetailsPanel.prototype.nodeStylesRefreshed):
(WebInspector.RulesStyleDetailsPanel.prototype.refresh): Deleted.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r185703 r185709  
     12015-06-18  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: New Rule button doesn't reveal the newly added rule if not visible upon creation
     4        https://bugs.webkit.org/show_bug.cgi?id=117600
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Views/RulesStyleDetailsPanel.js: Made previousFocusedSection into a member variable of the RulesStyleDetailsPanel.  This way, when the nodeStyles is refreshed (when a new rule is added), the previousFocusedSection will be scrolled into view.
     9        (WebInspector.RulesStyleDetailsPanel):
     10        (WebInspector.RulesStyleDetailsPanel.prototype.refresh.appendStyleSection):
     11        (WebInspector.RulesStyleDetailsPanel.prototype.nodeStylesRefreshed):
     12        (WebInspector.RulesStyleDetailsPanel.prototype.refresh): Deleted.
     13
    1142015-06-18  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js

    r185279 r185709  
    3131
    3232        this._sections = [];
     33        this._previousFocusedSection = null;
    3334        this._propertyToSelectAndHighlight = null;
    3435    }
     
    4849        var previousMediaList = [];
    4950        var previousSection = null;
    50         var previousFocusedSection = null;
    5151
    5252        function mediaListsEqual(a, b)
     
    117117        {
    118118            var section = style.__rulesSection;
    119             if (section && section.focused && !previousFocusedSection)
    120                 previousFocusedSection = section;
     119            if (section && section.focused && !this._previousFocusedSection)
     120                this._previousFocusedSection = section;
    121121
    122122            if (!section) {
     
    127127
    128128            if (this._focusNextNewInspectorRule && style.ownerRule && style.ownerRule.type === WebInspector.CSSRule.Type.Inspector) {
    129                 previousFocusedSection = section;
     129                this._previousFocusedSection = section;
    130130                delete this._focusNextNewInspectorRule;
    131131            }
     
    238238        for (var i = 0; i < this._sections.length; ++i)
    239239            this._sections[i].updateLayout();
    240 
    241         if (previousFocusedSection)
    242             previousFocusedSection.focus();
    243240    }
    244241
     
    305302            this._propertyToSelectAndHighlight = null;
    306303        }
     304
     305        if (this._previousFocusedSection && this._visible) {
     306            this._previousFocusedSection.focus();
     307            this._previousFocusedSection = null;
     308        }
    307309    }
    308310
Note: See TracChangeset for help on using the changeset viewer.