Changeset 238843 in webkit


Ignore:
Timestamp:
Dec 3, 2018 10:01:16 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Audit: save the expanded state of test groups
https://bugs.webkit.org/show_bug.cgi?id=192346
<rdar://problem/46440704>

Reviewed by Matt Baker.

  • UserInterface/Views/AuditTreeElement.js:

(WI.AuditTreeElement):
(WI.AuditTreeElement.prototype.onattach):
(WI.AuditTreeElement.prototype.onexpand): Added.
(WI.AuditTreeElement.prototype.oncollapse): Added.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r238842 r238843  
     12018-12-03  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Audit: save the expanded state of test groups
     4        https://bugs.webkit.org/show_bug.cgi?id=192346
     5        <rdar://problem/46440704>
     6
     7        Reviewed by Matt Baker.
     8
     9        * UserInterface/Views/AuditTreeElement.js:
     10        (WI.AuditTreeElement):
     11        (WI.AuditTreeElement.prototype.onattach):
     12        (WI.AuditTreeElement.prototype.onexpand): Added.
     13        (WI.AuditTreeElement.prototype.oncollapse): Added.
     14
    1152018-12-03  Devin Rousso  <drousso@apple.com>
    216
  • trunk/Source/WebInspectorUI/UserInterface/Views/AuditTreeElement.js

    r238822 r238843  
    5050        const subtitle = null;
    5151        super(classNames, representedObject.name, subtitle, representedObject, options);
     52
     53        if (isTestGroup)
     54            this._expandedSetting = new WI.Setting(`audit-tree-element-${this.representedObject.name}-expanded`, false);
    5255    }
    5356
     
    6669                this.representedObject.addEventListener(WI.AuditTestBase.Event.Scheduled, this._handleTestGroupScheduled, this);
    6770        }
     71
     72        if (this._expandedSetting && this._expandedSetting.value)
     73            this.expand();
    6874
    6975        this._updateLevel();
     
    95101                this.appendChild(new WI.AuditTreeElement(result));
    96102        }
     103    }
     104
     105    onexpand()
     106    {
     107        console.assert(this.expanded);
     108
     109        if (this._expandedSetting)
     110            this._expandedSetting.value = this.expanded;
     111    }
     112
     113    oncollapse()
     114    {
     115        console.assert(!this.expanded);
     116
     117        if (this._expandedSetting)
     118            this._expandedSetting.value = this.expanded;
    97119    }
    98120
Note: See TracChangeset for help on using the changeset viewer.