Changeset 162931 in webkit


Ignore:
Timestamp:
Jan 28, 2014, 7:40:29 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: In a DataGrid, store value of columnIdentifier to DOM node representing a cell
​https://bugs.webkit.org/show_bug.cgi?id=127613

Patch by Diego Pino Garcia <Diego Pino Garcia> on 2014-01-28
Reviewed by Timothy Hatcher.

  • UserInterface/DOMStorageContentView.js:

(WebInspector.DOMStorageContentView.prototype._editingCallback):

  • UserInterface/DataGrid.js:

(WebInspector.DataGrid):
(WebInspector.DataGrid.prototype._keyDown):
(WebInspector.DataGrid.prototype._contextMenuInDataTable):
(WebInspector.DataGridNode.prototype.createCell):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r162874 r162931  
     12014-01-28  Diego Pino Garcia  <dpino@igalia.com>
     2
     3        Web Inspector: In a DataGrid, store value of columnIdentifier to DOM node representing a cell
     4        https://bugs.webkit.org/show_bug.cgi?id=127613
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/DOMStorageContentView.js:
     9        (WebInspector.DOMStorageContentView.prototype._editingCallback):
     10        * UserInterface/DataGrid.js:
     11        (WebInspector.DataGrid):
     12        (WebInspector.DataGrid.prototype._keyDown):
     13        (WebInspector.DataGrid.prototype._contextMenuInDataTable):
     14        (WebInspector.DataGridNode.prototype.createCell):
     15
    1162014-01-27  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/DOMStorageContentView.js

    r157269 r162931  
    216216    {
    217217        var domStorage = this.representedObject;
    218         if (columnIdentifier === 0) {
     218        if (columnIdentifier === "0") {
    219219            if (oldText)
    220220                domStorage.removeItem(oldText);
  • trunk/Source/WebInspectorUI/UserInterface/DataGrid.js

    r162416 r162931  
    154154        var td = document.createElement("td");
    155155        td.className = columnIdentifier + "-column";
     156        td.__columnIdentifier = columnIdentifier;
    156157        var group = this.groups[columnIdentifier];
    157158        if (group)
     
    344345        // Not needed yet since only editable DataGrid is DOM Storage, which is Key - Value.
    345346
    346         // FIXME: Better way to do this than regular expressions?
    347         var columnIdentifier = parseInt(element.className.match(/\b(\d+)-column\b/)[1], 10);
     347        var columnIdentifier = element.__columnIdentifier;
    348348
    349349        var textBeforeEditing = this._editingNode.data[columnIdentifier] || "";
     
    902902            if (this._editCallback) {
    903903                handled = true;
    904                 // The first child of the selected element is the <td class="0-column">,
    905                 // and that's what we want to edit.
    906904                this._startEditing(this.selectedNode._element.children[0]);
    907905            }
     
    11381136                else {
    11391137                    var element = event.target.enclosingNodeOrSelfWithNodeName("td");
    1140                     var columnIdentifier = parseInt(element.className.match(/\b(\d+)-column\b/)[1], 10);
     1138                    var columnIdentifier = element.__columnIdentifier;
    11411139                    var columnTitle = this.dataGrid.columns[columnIdentifier].title;
    11421140                    contextMenu.appendItem(WebInspector.UIString("Edit ā€œ%sā€").format(columnTitle), this._startEditing.bind(this, event.target));
     
    15191517        var cell = document.createElement("td");
    15201518        cell.className = columnIdentifier + "-column";
     1519        cell.__columnIdentifier = columnIdentifier;
    15211520
    15221521        var alignment = this.dataGrid.aligned[columnIdentifier];
Note: See TracChangeset for help on using the changeset viewer.