Changeset 31644 in webkit


Ignore:
Timestamp:
Apr 4, 2008 1:29:47 PM (16 years ago)
Author:
timothy@apple.com
Message:

Makes setting shouldRefreshChildren on a TreeElement perform the refresh
immediately if the element is already expanded.

Reviewed by Adam Roben.

  • page/inspector/treeoutline.js:

(TreeElement.prototype.get shouldRefreshChildren): Return this._shouldRefreshChildren.
(TreeElement.prototype.set shouldRefreshChildren): If changing to true, and
already expanded,
call expand again to trigger the refresh. Sets this._shouldRefreshChildren.
(TreeElement.prototype._attach): Check for this._shouldRefreshChildren.
(TreeElement.prototype.expand): Ditto.

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31643 r31644  
     12008-04-04  Timothy Hatcher  <timothy@apple.com>
     2
     3        Makes setting shouldRefreshChildren on a TreeElement perform the refresh
     4        immediately if the element is already expanded.
     5
     6        Reviewed by Adam Roben.
     7
     8        * page/inspector/treeoutline.js:
     9        (TreeElement.prototype.get shouldRefreshChildren): Return this._shouldRefreshChildren.
     10        (TreeElement.prototype.set shouldRefreshChildren): If changing to true, and
     11        already expanded,
     12        call expand again to trigger the refresh. Sets this._shouldRefreshChildren.
     13        (TreeElement.prototype._attach): Check for this._shouldRefreshChildren.
     14        (TreeElement.prototype.expand): Ditto.
     15
    1162008-04-04  Jon Honeycutt  <jhoneycutt@apple.com>
    217
  • trunk/WebCore/page/inspector/treeoutline.js

    r31642 r31644  
    461461                this._childrenListNode.removeStyleClass("hidden");
    462462        }
     463    },
     464
     465    get shouldRefreshChildren() {
     466        return this._shouldRefreshChildren;
     467    },
     468
     469    set shouldRefreshChildren(x) {
     470        this._shouldRefreshChildren = x;
     471        if (x && this.expanded)
     472            this.expand();
    463473    }
    464474}
     
    472482TreeElement.prototype._attach = function()
    473483{
    474     if (!this._listItemNode || this.parent.refreshChildren) {
     484    if (!this._listItemNode || this.parent._shouldRefreshChildren) {
    475485        if (this._listItemNode && this._listItemNode.parentNode)
    476486            this._listItemNode.parentNode.removeChild(this._listItemNode);
     
    588598TreeElement.prototype.expand = function()
    589599{
    590     if (!this.hasChildren || (this.expanded && !this.refreshChildren && this._childrenListNode))
    591         return;
    592 
    593     if (!this._childrenListNode || this.refreshChildren) {
     600    if (!this.hasChildren || (this.expanded && !this._shouldRefreshChildren && this._childrenListNode))
     601        return;
     602
     603    if (!this._childrenListNode || this._shouldRefreshChildren) {
    594604        if (this._childrenListNode && this._childrenListNode.parentNode)
    595605            this._childrenListNode.parentNode.removeChild(this._childrenListNode);
     
    608618            this.children[i]._attach();
    609619
    610         delete this.refreshChildren;
     620        delete this._shouldRefreshChildren;
    611621    }
    612622
Note: See TracChangeset for help on using the changeset viewer.