OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 /** @type {?TreeOutline} */ | 305 /** @type {?TreeOutline} */ |
306 this.treeOutline = null; | 306 this.treeOutline = null; |
307 this.parent = null; | 307 this.parent = null; |
308 this.previousSibling = null; | 308 this.previousSibling = null; |
309 this.nextSibling = null; | 309 this.nextSibling = null; |
310 | 310 |
311 this._listItemNode = createElement("li"); | 311 this._listItemNode = createElement("li"); |
312 this._listItemNode.treeElement = this; | 312 this._listItemNode.treeElement = this; |
313 if (title) | 313 if (title) |
314 this.title = title; | 314 this.title = title; |
315 if (typeof title === "string") | |
pfeldman
2015/08/19 19:08:42
This I am fine with.
| |
316 this.tooltip = title; | |
317 this._listItemNode.addEventListener("mousedown", this._handleMouseDown.bind( this), false); | 315 this._listItemNode.addEventListener("mousedown", this._handleMouseDown.bind( this), false); |
318 this._listItemNode.addEventListener("selectstart", this._treeElementSelectSt art.bind(this), false); | 316 this._listItemNode.addEventListener("selectstart", this._treeElementSelectSt art.bind(this), false); |
319 this._listItemNode.addEventListener("click", this._treeElementToggled.bind(t his), false); | 317 this._listItemNode.addEventListener("click", this._treeElementToggled.bind(t his), false); |
320 this._listItemNode.addEventListener("dblclick", this._handleDoubleClick.bind (this), false); | 318 this._listItemNode.addEventListener("dblclick", this._handleDoubleClick.bind (this), false); |
321 | 319 |
322 this._childrenListNode = createElement("ol"); | 320 this._childrenListNode = createElement("ol"); |
323 this._childrenListNode.parentTreeElement = this; | 321 this._childrenListNode.parentTreeElement = this; |
324 this._childrenListNode.classList.add("children"); | 322 this._childrenListNode.classList.add("children"); |
325 | 323 |
326 this._hidden = false; | 324 this._hidden = false; |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1068 isEventWithinDisclosureTriangle: function(event) | 1066 isEventWithinDisclosureTriangle: function(event) |
1069 { | 1067 { |
1070 // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446) | 1068 // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446) |
1071 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi ngLeft; | 1069 var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddi ngLeft; |
1072 console.assert(paddingLeftValue.endsWith("px")); | 1070 console.assert(paddingLeftValue.endsWith("px")); |
1073 var computedLeftPadding = parseFloat(paddingLeftValue); | 1071 var computedLeftPadding = parseFloat(paddingLeftValue); |
1074 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; | 1072 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
1075 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo ggleWidth && this._expandable; | 1073 return event.pageX >= left && event.pageX <= left + TreeElement._ArrowTo ggleWidth && this._expandable; |
1076 } | 1074 } |
1077 } | 1075 } |
OLD | NEW |