| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * | 10 * |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 { | 971 { |
| 972 this._warmedUpContent = content; | 972 this._warmedUpContent = content; |
| 973 } | 973 } |
| 974 }, | 974 }, |
| 975 | 975 |
| 976 _shouldRenameOnMouseDown: function() | 976 _shouldRenameOnMouseDown: function() |
| 977 { | 977 { |
| 978 if (!this._uiSourceCode.canRename()) | 978 if (!this._uiSourceCode.canRename()) |
| 979 return false; | 979 return false; |
| 980 var isSelected = this === this.treeOutline.selectedTreeElement; | 980 var isSelected = this === this.treeOutline.selectedTreeElement; |
| 981 var document = this.treeOutline.element.ownerDocument; | 981 return isSelected && this.treeOutline.element.hasFocus() && !WebInspecto
r.isBeingEdited(this.treeOutline.element); |
| 982 var isFocused = this.treeOutline.element.isSelfOrAncestor(document.activ
eElement); | |
| 983 return isSelected && isFocused && !WebInspector.isBeingEdited(this.treeO
utline.element); | |
| 984 }, | 982 }, |
| 985 | 983 |
| 986 selectOnMouseDown: function(event) | 984 selectOnMouseDown: function(event) |
| 987 { | 985 { |
| 988 if (event.which !== 1 || !this._shouldRenameOnMouseDown()) { | 986 if (event.which !== 1 || !this._shouldRenameOnMouseDown()) { |
| 989 TreeElement.prototype.selectOnMouseDown.call(this, event); | 987 TreeElement.prototype.selectOnMouseDown.call(this, event); |
| 990 return; | 988 return; |
| 991 } | 989 } |
| 992 setTimeout(rename.bind(this), 300); | 990 setTimeout(rename.bind(this), 300); |
| 993 | 991 |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1633 return; | 1631 return; |
| 1634 this._treeElement.listItemElement.classList.toggle("has-mapped-files", i
sActive); | 1632 this._treeElement.listItemElement.classList.toggle("has-mapped-files", i
sActive); |
| 1635 if (isActive) | 1633 if (isActive) |
| 1636 this._treeElement.expand(); | 1634 this._treeElement.expand(); |
| 1637 else | 1635 else |
| 1638 this._treeElement.collapse(); | 1636 this._treeElement.collapse(); |
| 1639 }, | 1637 }, |
| 1640 | 1638 |
| 1641 __proto__: WebInspector.NavigatorTreeNode.prototype | 1639 __proto__: WebInspector.NavigatorTreeNode.prototype |
| 1642 } | 1640 } |
| OLD | NEW |