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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 return null; | 276 return null; |
277 | 277 |
278 var elements = this._treeElementsMap.get(representedObject); | 278 var elements = this._treeElementsMap.get(representedObject); |
279 if (elements && elements.length) | 279 if (elements && elements.length) |
280 return elements[0]; | 280 return elements[0]; |
281 return null; | 281 return null; |
282 } | 282 } |
283 | 283 |
284 /** | 284 /** |
285 * @param {?Object} representedObject | 285 * @param {?Object} representedObject |
| 286 * @param {function(!Object, !Object):boolean} isAncestor |
| 287 * @param {function(!Object):?Object} getParent |
286 * @return {?TreeElement} | 288 * @return {?TreeElement} |
287 */ | 289 */ |
288 TreeOutline.prototype.findTreeElement = function(representedObject, isAncestor,
getParent) | 290 TreeOutline.prototype.findTreeElement = function(representedObject, isAncestor,
getParent) |
289 { | 291 { |
290 if (!representedObject) | 292 if (!representedObject) |
291 return null; | 293 return null; |
292 | 294 |
293 var cachedElement = this.getCachedTreeElement(representedObject); | 295 var cachedElement = this.getCachedTreeElement(representedObject); |
294 if (cachedElement) | 296 if (cachedElement) |
295 return cachedElement; | 297 return cachedElement; |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 } | 968 } |
967 | 969 |
968 TreeElement.prototype.isEventWithinDisclosureTriangle = function(event) | 970 TreeElement.prototype.isEventWithinDisclosureTriangle = function(event) |
969 { | 971 { |
970 // FIXME: We should not use getComputedStyle(). For that we need to get rid
of using ::before for disclosure triangle. (http://webk.it/74446) | 972 // FIXME: We should not use getComputedStyle(). For that we need to get rid
of using ::before for disclosure triangle. (http://webk.it/74446) |
971 var paddingLeftValue = window.getComputedStyle(this._listItemNode).getProper
tyCSSValue("padding-left"); | 973 var paddingLeftValue = window.getComputedStyle(this._listItemNode).getProper
tyCSSValue("padding-left"); |
972 var computedLeftPadding = paddingLeftValue ? paddingLeftValue.getFloatValue(
CSSPrimitiveValue.CSS_PX) : 0; | 974 var computedLeftPadding = paddingLeftValue ? paddingLeftValue.getFloatValue(
CSSPrimitiveValue.CSS_PX) : 0; |
973 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; | 975 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
974 return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth &&
this.hasChildren; | 976 return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth &&
this.hasChildren; |
975 } | 977 } |
OLD | NEW |