| OLD | NEW |
| 1 (function() { | 1 (function() { |
| 2 'use strict'; | 2 'use strict'; |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * The IronDropdownScrollManager is intended to provide a central source | 5 * The IronDropdownScrollManager is intended to provide a central source |
| 6 * of authority and control over which elements in a document are currently | 6 * of authority and control over which elements in a document are currently |
| 7 * allowed to scroll. | 7 * allowed to scroll. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 Polymer.IronDropdownScrollManager = { | 10 Polymer.IronDropdownScrollManager = { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (this._composedTreeContains(distributedNodes[nodeIndex], child))
{ | 154 if (this._composedTreeContains(distributedNodes[nodeIndex], child))
{ |
| 155 return true; | 155 return true; |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 return false; | 160 return false; |
| 161 }, | 161 }, |
| 162 | 162 |
| 163 _scrollInteractionHandler: function(event) { | 163 _scrollInteractionHandler: function(event) { |
| 164 var scrolledElement = |
| 165 /** @type {HTMLElement} */(Polymer.dom(event).rootTarget); |
| 164 if (Polymer | 166 if (Polymer |
| 165 .IronDropdownScrollManager | 167 .IronDropdownScrollManager |
| 166 .elementIsScrollLocked(Polymer.dom(event).rootTarget)) { | 168 .elementIsScrollLocked(scrolledElement)) { |
| 167 if (event.type === 'keydown' && | 169 if (event.type === 'keydown' && |
| 168 !Polymer.IronDropdownScrollManager._isScrollingKeypress(event)) { | 170 !Polymer.IronDropdownScrollManager._isScrollingKeypress(event)) { |
| 169 return; | 171 return; |
| 170 } | 172 } |
| 171 | 173 |
| 172 event.preventDefault(); | 174 event.preventDefault(); |
| 173 } | 175 } |
| 174 }, | 176 }, |
| 175 | 177 |
| 176 _lockScrollInteractions: function() { | 178 _lockScrollInteractions: function() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 207 document.body.style.overflowY = this._originalBodyStyles.overflowY; | 209 document.body.style.overflowY = this._originalBodyStyles.overflowY; |
| 208 | 210 |
| 209 document.removeEventListener('wheel', this._scrollInteractionHandler, tr
ue); | 211 document.removeEventListener('wheel', this._scrollInteractionHandler, tr
ue); |
| 210 document.removeEventListener('mousewheel', this._scrollInteractionHandle
r, true); | 212 document.removeEventListener('mousewheel', this._scrollInteractionHandle
r, true); |
| 211 document.removeEventListener('DOMMouseScroll', this._scrollInteractionHa
ndler, true); | 213 document.removeEventListener('DOMMouseScroll', this._scrollInteractionHa
ndler, true); |
| 212 document.removeEventListener('touchmove', this._scrollInteractionHandler
, true); | 214 document.removeEventListener('touchmove', this._scrollInteractionHandler
, true); |
| 213 document.removeEventListener('keydown', this._scrollInteractionHandler,
true); | 215 document.removeEventListener('keydown', this._scrollInteractionHandler,
true); |
| 214 } | 216 } |
| 215 }; | 217 }; |
| 216 })(); | 218 })(); |
| OLD | NEW |