OLD | NEW |
1 <!-- | 1 <!-- |
2 @license | 2 @license |
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | 3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 4 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 6 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
7 Code distributed by Google as part of the polymer project is also | 7 Code distributed by Google as part of the polymer project is also |
8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 8 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
9 --> | 9 --> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 _focusBlurHandler: function(event) { | 67 _focusBlurHandler: function(event) { |
68 // NOTE(cdata): if we are in ShadowDOM land, `event.target` will | 68 // NOTE(cdata): if we are in ShadowDOM land, `event.target` will |
69 // eventually become `this` due to retargeting; if we are not in | 69 // eventually become `this` due to retargeting; if we are not in |
70 // ShadowDOM land, `event.target` will eventually become `this` due | 70 // ShadowDOM land, `event.target` will eventually become `this` due |
71 // to the second conditional which fires a synthetic event (that is also | 71 // to the second conditional which fires a synthetic event (that is also |
72 // handled). In either case, we can disregard `event.path`. | 72 // handled). In either case, we can disregard `event.path`. |
73 | 73 |
74 if (event.target === this) { | 74 if (event.target === this) { |
75 this._setFocused(event.type === 'focus'); | 75 this._setFocused(event.type === 'focus'); |
76 } else if (!this.shadowRoot && !this.isLightDescendant(event.target)) { | 76 } else if (!this.shadowRoot) { |
77 this.fire(event.type, {sourceEvent: event}, { | 77 var target = /** @type {Node} */(Polymer.dom(event).localTarget); |
78 node: this, | 78 if (!this.isLightDescendant(target)) { |
79 bubbles: event.bubbles, | 79 this.fire(event.type, {sourceEvent: event}, { |
80 cancelable: event.cancelable | 80 node: this, |
81 }); | 81 bubbles: event.bubbles, |
| 82 cancelable: event.cancelable |
| 83 }); |
| 84 } |
82 } | 85 } |
83 }, | 86 }, |
84 | 87 |
85 _disabledChanged: function(disabled, old) { | 88 _disabledChanged: function(disabled, old) { |
86 this.setAttribute('aria-disabled', disabled ? 'true' : 'false'); | 89 this.setAttribute('aria-disabled', disabled ? 'true' : 'false'); |
87 this.style.pointerEvents = disabled ? 'none' : ''; | 90 this.style.pointerEvents = disabled ? 'none' : ''; |
88 if (disabled) { | 91 if (disabled) { |
89 this._oldTabIndex = this.tabIndex; | 92 this._oldTabIndex = this.tabIndex; |
90 this._setFocused(false); | 93 this._setFocused(false); |
91 this.tabIndex = -1; | 94 this.tabIndex = -1; |
92 this.blur(); | 95 this.blur(); |
93 } else if (this._oldTabIndex !== undefined) { | 96 } else if (this._oldTabIndex !== undefined) { |
94 this.tabIndex = this._oldTabIndex; | 97 this.tabIndex = this._oldTabIndex; |
95 } | 98 } |
96 }, | 99 }, |
97 | 100 |
98 _changedControlState: function() { | 101 _changedControlState: function() { |
99 // _controlStateChanged is abstract, follow-on behaviors may implement it | 102 // _controlStateChanged is abstract, follow-on behaviors may implement it |
100 if (this._controlStateChanged) { | 103 if (this._controlStateChanged) { |
101 this._controlStateChanged(); | 104 this._controlStateChanged(); |
102 } | 105 } |
103 } | 106 } |
104 | 107 |
105 }; | 108 }; |
106 | 109 |
107 </script> | 110 </script> |
OLD | NEW |