Changeset 180935 in webkit


Ignore:
Timestamp:
Mar 3, 2015 8:52:09 AM (9 years ago)
Author:
Brian Burg
Message:

Web Inspector: Console log level selector loses selection on reload
https://bugs.webkit.org/show_bug.cgi?id=142199

Reviewed by Timothy Hatcher.

The selected items in the console scope bar were being saved as settings,
but the "All" scope is forcibly selected on reload due to a logic bug.

  • UserInterface/Base/Main.js:

(WebInspector.showFullHeightConsole):
The scope bar may already have selected items restored from WebInspector.Settings.
Don't select a scope unless explicitly requested (i.e., clicking on dashboard buttons)
or if no scopes are selected at all. (In the latter case, "All" is the default scope.)

  • UserInterface/Views/LogContentView.js:

(WebInspector.LogContentView): Don't specify a default value here to avoid trampling
settings. The "All" scope is selected by default in showFullHeightConsole if
nothing else is selected.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r180916 r180935  
     12015-03-03  Brian J. Burg  <burg@cs.washington.edu>
     2
     3        Web Inspector: Console log level selector loses selection on reload
     4        https://bugs.webkit.org/show_bug.cgi?id=142199
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        The selected items in the console scope bar were being saved as settings,
     9        but the "All" scope is forcibly selected on reload due to a logic bug.
     10
     11        * UserInterface/Base/Main.js:
     12        (WebInspector.showFullHeightConsole):
     13        The scope bar may already have selected items restored from WebInspector.Settings.
     14        Don't select a scope unless explicitly requested (i.e., clicking on dashboard buttons)
     15        or if no scopes are selected at all. (In the latter case, "All" is the default scope.)
     16
     17        * UserInterface/Views/LogContentView.js:
     18        (WebInspector.LogContentView): Don't specify a default value here to avoid trampling
     19        settings. The "All" scope is selected by default in showFullHeightConsole if
     20        nothing else is selected.
     21
    1222015-03-02  Joseph Pecoraro  <pecoraro@apple.com>
    223
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r180913 r180935  
    623623};
    624624
    625 WebInspector.showFullHeightConsole = function(scope)
     625WebInspector.showFullHeightConsole = function(requestedScope)
    626626{
    627627    this.splitContentBrowser.element.classList.add("hidden");
     
    629629    this._showingSplitConsoleSetting.value = false;
    630630
    631     scope = scope || WebInspector.LogContentView.Scopes.All;
     631    var scope = requestedScope || WebInspector.LogContentView.Scopes.All;
    632632
    633633    // If the requested scope is already selected and the console is showing, then switch back to All.
     
    635635        scope = WebInspector.LogContentView.Scopes.All;
    636636
    637     this.consoleContentView.scopeBar.item(scope).selected = true;
     637    if (requestedScope || !this.consoleContentView.scopeBar.selectedItems.length)
     638        this.consoleContentView.scopeBar.item(scope).selected = true;
    638639
    639640    if (!this.contentBrowser.currentContentView || this.contentBrowser.currentContentView !== this.consoleContentView) {
  • trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js

    r180913 r180935  
    5555
    5656    var scopeBarItems = [
    57         new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.All, WebInspector.UIString("All"), true),
     57        new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.All, WebInspector.UIString("All")),
    5858        new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Errors, WebInspector.UIString("Errors")),
    5959        new WebInspector.ScopeBarItem(WebInspector.LogContentView.Scopes.Warnings, WebInspector.UIString("Warnings")),
Note: See TracChangeset for help on using the changeset viewer.