Changeset 90360 in webkit


Ignore:
Timestamp:
Jul 4, 2011 4:55:59 AM (13 years ago)
Author:
apavlov@chromium.org
Message:

2011-07-04 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Adding new CSS rules should be more discoverable in the UI
https://bugs.webkit.org/show_bug.cgi?id=63803

  • inspector/front-end/StylesSidebarPane.js: (WebInspector.StylesSidebarPane.prototype._createNewRule):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r90359 r90360  
     12011-07-04  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Adding new CSS rules should be more discoverable in the UI
     6        https://bugs.webkit.org/show_bug.cgi?id=63803
     7
     8        * inspector/front-end/StylesSidebarPane.js:
     9        (WebInspector.StylesSidebarPane.prototype._createNewRule):
     10
    1112011-07-04  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
    212
  • trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js

    r90136 r90360  
    5959    this.settingsSelectElement.appendChild(option);
    6060
    61     this.settingsSelectElement.appendChild(document.createElement("hr"));
    62 
    63     option = document.createElement("option");
    64     option.action = this._createNewRule.bind(this);
    65     option.label = WebInspector.UIString("New Style Rule");
    66     this.settingsSelectElement.appendChild(option);
    67 
    6861    this.settingsSelectElement.addEventListener("click", function(event) { event.stopPropagation() }, false);
    6962    this.settingsSelectElement.addEventListener("change", this._changeSetting.bind(this), false);
     
    7972
    8073    this.titleElement.appendChild(this.settingsSelectElement);
     74
     75    var addButton = document.createElement("button");
     76    addButton.className = "pane-title-button add";
     77    addButton.title = WebInspector.UIString("New Style Rule");
     78    addButton.addEventListener("click", this._createNewRule.bind(this), false);
     79    this.titleElement.appendChild(addButton);
     80
    8181    this._computedStylePane = computedStylePane;
    8282    this.element.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);
     
    579579    _createNewRule: function(event)
    580580    {
     581        event.stopPropagation();
     582        if (WebInspector.isEditingAnyField())
     583            return;
     584
    581585        this.expanded = true;
    582586        this.addBlankSection().startEditingSelector();
Note: See TracChangeset for help on using the changeset viewer.