Commit ce64f8a3 authored by timothy@apple.com's avatar timothy@apple.com

Reviewed by Mark Rowe.

        Prevent selecting a word in the breadcrumb or the styles section when double
        clicking on a DOM node in the outline tree.

        * page/inspector/DocumentPanel.js: Call preventDefault() when a mousedown event
          with a detail of 2 or higher comes in. This prevents the selection.
        * page/inspector/inspector.css: Mark the breadcrumb as user-select: none.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3962570f
2007-11-12 Timothy Hatcher <timothy@apple.com>
Reviewed by Mark Rowe.
Prevent selecting a word in the breadcrumb or the styles section when double
clicking on a DOM node in the outline tree.
* page/inspector/DocumentPanel.js: Call preventDefault() when a mousedown event
with a detail of 2 or higher comes in. This prevents the selection.
* page/inspector/inspector.css: Mark the breadcrumb as user-select: none.
2007-11-12 Oliver Hunt <oliver@apple.com> 2007-11-12 Oliver Hunt <oliver@apple.com>
Reviewed by Darin and Antti. Reviewed by Darin and Antti.
......
...@@ -439,6 +439,12 @@ WebInspector.DOMNodeTreeElement.prototype = { ...@@ -439,6 +439,12 @@ WebInspector.DOMNodeTreeElement.prototype = {
this.selectionElement.style.height = listItemElement.offsetHeight + "px"; this.selectionElement.style.height = listItemElement.offsetHeight + "px";
}, },
onattach: function()
{
var element = this;
this.listItemElement.addEventListener("mousedown", function(event) { element.onmousedown(event) }, false);
},
onpopulate: function() onpopulate: function()
{ {
if (this.children.length || this.whitespaceIgnored !== Preferences.ignoreWhitespace) if (this.children.length || this.whitespaceIgnored !== Preferences.ignoreWhitespace)
...@@ -490,6 +496,13 @@ WebInspector.DOMNodeTreeElement.prototype = { ...@@ -490,6 +496,13 @@ WebInspector.DOMNodeTreeElement.prototype = {
setTimeout(function() { element.updateSelection() }, 0); setTimeout(function() { element.updateSelection() }, 0);
}, },
onmousedown: function(event)
{
// Prevent selecting the nearest word on double click.
if (event.detail >= 2)
event.preventDefault();
},
ondblclick: function() ondblclick: function()
{ {
var panel = this.treeOutline.panel; var panel = this.treeOutline.panel;
......
...@@ -818,6 +818,7 @@ body.inactive #sidebar li.selected { ...@@ -818,6 +818,7 @@ body.inactive #sidebar li.selected {
} }
.crumbs { .crumbs {
-webkit-user-select: none;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
position: absolute; position: absolute;
left: 0; left: 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment