Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js

Issue 2346873005: [DevTools] Do not toggle tree element if there is a selection. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
index 88a8d74fa8fa4309decd37030b498880bdedf86f..d89fc48f5685235f4c4d4a9ebd91b899ad30fd3d 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
@@ -368,7 +368,6 @@ function TreeElement(title, expandable)
if (title)
this.title = title;
this._listItemNode.addEventListener("mousedown", this._handleMouseDown.bind(this), false);
- this._listItemNode.addEventListener("selectstart", this._treeElementSelectStart.bind(this), false);
this._listItemNode.addEventListener("click", this._treeElementToggled.bind(this), false);
this._listItemNode.addEventListener("dblclick", this._handleDoubleClick.bind(this), false);
@@ -779,25 +778,10 @@ TreeElement.prototype = {
/**
* @param {!Event} event
*/
- _treeElementSelectStart: function(event)
- {
- event.currentTarget._selectionStarted = true;
- },
-
- /**
- * @param {!Event} event
- */
_treeElementToggled: function(event)
{
var element = event.currentTarget;
- if (element._selectionStarted) {
- delete element._selectionStarted;
- var selection = element.getComponentSelection();
- if (selection && !selection.isCollapsed && element.isSelfOrAncestor(selection.anchorNode) && element.isSelfOrAncestor(selection.focusNode))
- return;
- }
-
- if (element.treeElement !== this)
+ if (element.treeElement !== this || element.hasSelection())
pfeldman 2016/09/16 22:54:18 hasSelection returns true upon mouse down?
dgozman 2016/09/16 23:00:47 Correct.
return;
var toggleOnClick = this.toggleOnClick && !this.selectable;
@@ -830,8 +814,6 @@ TreeElement.prototype = {
var element = event.currentTarget;
if (!element)
return;
- delete element._selectionStarted;
-
if (!this.selectable)
return;
if (element.treeElement !== this)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698