https://bugs.webkit.org/show_bug.cgi?id=77627
Reviewed by Vsevolod Vlasov.
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeElement.prototype.onattach):
(WebInspector.ElementsTreeElement.prototype.onselect):
(WebInspector.ElementsTreeElement.prototype._mouseDown):
* inspector/front-end/treeoutline.js:
(TreeElement.prototype.selectOnMouseDown):
(TreeElement.prototype.select):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106552
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-02 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: enable editing of selected rows on single click in elements panel.
+ https://bugs.webkit.org/show_bug.cgi?id=77627
+
+ Reviewed by Vsevolod Vlasov.
+
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype.onattach):
+ (WebInspector.ElementsTreeElement.prototype.onselect):
+ (WebInspector.ElementsTreeElement.prototype._mouseDown):
+ * inspector/front-end/treeoutline.js:
+ (TreeElement.prototype.selectOnMouseDown):
+ (TreeElement.prototype.select):
+
2012-02-02 Philip Rogers <pdr@google.com>
Fix mirroring with SVG fonts
this.updateTitle();
this._preventFollowingLinksOnDoubleClick();
this.listItemElement.draggable = true;
+ this.listItemElement.addEventListener("click", this._mouseClick.bind(this));
+ this.listItemElement.addEventListener("mousedown", this._mouseDown.bind(this));
},
_preventFollowingLinksOnDoubleClick: function()
WebInspector.domAgent.highlightDOMNode(this.representedObject.id);
this.updateSelection();
this.treeOutline.suppressRevealAndSelect = false;
+ return true;
},
ondelete: function()
this.expand();
},
+ _mouseClick: function(event)
+ {
+ if (this._isSingleClickCandidate)
+ this._startEditingTarget(event.target);
+ this._isSingleClickCandidate = false;
+ },
+
+ _mouseDown: function(event)
+ {
+ if (event.handled || event.which !== 1 || this._editing || this._elementCloseTag || !this.selected)
+ return;
+ this._isSingleClickCandidate = true;
+ },
+
_insertInLastAttributePosition: function(tag, node)
{
if (tag.getElementsByClassName("webkit-html-attribute").length > 0)
TreeElement.prototype.selectOnMouseDown = function(event)
{
- this.select(false, true);
+ if (this.select(false, true)) {
+ event.stopPropagation();
+ event.preventDefault();
+ event.handled = true;
+ }
}
/**
* @param {boolean=} omitFocus
* @param {boolean=} selectedByUser
+ * @return {boolean}
*/
TreeElement.prototype.select = function(omitFocus, selectedByUser)
{
if (!this.treeOutline || !this.selectable || this.selected)
- return;
+ return false;
if (this.treeOutline.selectedTreeElement)
this.treeOutline.selectedTreeElement.deselect();
// Focusing on another node may detach "this" from tree.
if (!this.treeOutline)
- return;
+ return false;
this.treeOutline.selectedTreeElement = this;
if (this._listItemNode)
this._listItemNode.classList.add("selected");
if (this.onselect)
- this.onselect(this, selectedByUser);
+ return this.onselect(this, selectedByUser);
+ return false;
}
/**