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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 return element; | 991 return element; |
992 | 992 |
993 if (!this.parent || this.parent.root) | 993 if (!this.parent || this.parent.root) |
994 return null; | 994 return null; |
995 | 995 |
996 return this.parent; | 996 return this.parent; |
997 } | 997 } |
998 | 998 |
999 TreeElement.prototype.isEventWithinDisclosureTriangle = function(event) | 999 TreeElement.prototype.isEventWithinDisclosureTriangle = function(event) |
1000 { | 1000 { |
1001 const leftPadding = 14; | 1001 // FIXME: We should not use getComputedStyle(). For that we need to get rid
of using ::before for disclosure triangle. (http://webk.it/74446) |
1002 var left = this._listItemNode.totalOffsetLeft() + leftPadding; | 1002 var computedLeftPadding = window.getComputedStyle(this._listItemNode).getPro
pertyCSSValue("padding-left").getFloatValue(CSSPrimitiveValue.CSS_PX); |
| 1003 var left = this._listItemNode.totalOffsetLeft() + computedLeftPadding; |
1003 return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth &&
this.hasChildren; | 1004 return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth &&
this.hasChildren; |
1004 } | 1005 } |
OLD | NEW |