OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2014 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/base/event.html"> | 8 <link rel="import" href="/tracing/base/event.html"> |
9 <link rel="import" href="/tracing/base/utils.html"> | 9 <link rel="import" href="/tracing/base/utils.html"> |
10 <link rel="import" href="/tracing/ui/base/ui.html"> | 10 <link rel="import" href="/tracing/ui/base/ui.html"> |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 onVisibleChange_: function() { | 219 onVisibleChange_: function() { |
220 this.visible_ ? this.show_() : this.hide_(); | 220 this.visible_ ? this.show_() : this.hide_(); |
221 }, | 221 }, |
222 | 222 |
223 show_: function() { | 223 show_: function() { |
224 Polymer.dom(this.parentEl_).appendChild(this); | 224 Polymer.dom(this.parentEl_).appendChild(this); |
225 | 225 |
226 if (this.userCanClose_) { | 226 if (this.userCanClose_) { |
227 this.addEventListener('keydown', this.onKeyDown_.bind(this)); | 227 this.addEventListener('keydown', this.onKeyDown_.bind(this)); |
228 this.addEventListener('click', this.onDocumentClick_.bind(this)); | 228 this.addEventListener('click', this.onDocumentClick_.bind(this)); |
| 229 this.closeBtn_.addEventListener('click', this.onClose_); |
229 } | 230 } |
230 | 231 |
231 this.parentEl_.addEventListener('focusin', this.onFocusIn_); | 232 this.parentEl_.addEventListener('focusin', this.onFocusIn_); |
232 this.tabIndex = 0; | 233 this.tabIndex = 0; |
233 | 234 |
234 // Focus the first thing we find that makes sense. (Skip the close button | 235 // Focus the first thing we find that makes sense. (Skip the close button |
235 // as it doesn't make sense as the first thing to focus.) | 236 // as it doesn't make sense as the first thing to focus.) |
236 var focusEl = undefined; | 237 var focusEl = undefined; |
237 var elList = | 238 var elList = |
238 Polymer.dom(this).querySelectorAll('button, input, list, select, a'); | 239 Polymer.dom(this).querySelectorAll('button, input, list, select, a'); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 Polymer.dom(o.buttons).appendChild(b); | 339 Polymer.dom(o.buttons).appendChild(b); |
339 o.visible = true; | 340 o.visible = true; |
340 return o; | 341 return o; |
341 }; | 342 }; |
342 | 343 |
343 return { | 344 return { |
344 Overlay: Overlay | 345 Overlay: Overlay |
345 }; | 346 }; |
346 }); | 347 }); |
347 </script> | 348 </script> |
OLD | NEW |