| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 cr.define('downloads', function() { | 5 cr.define('downloads', function() { |
| 6 var Toolbar = Polymer({ | 6 var Toolbar = Polymer({ |
| 7 is: 'downloads-toolbar', | 7 is: 'downloads-toolbar', |
| 8 | 8 |
| 9 attached: function() { | 9 attached: function() { |
| 10 // isRTL() only works after i18n_template.js runs to set <html dir>. | 10 // isRTL() only works after i18n_template.js runs to set <html dir>. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * @param {!Event} e | 69 * @param {!Event} e |
| 70 * @private | 70 * @private |
| 71 */ | 71 */ |
| 72 onItemBlur_: function(e) { | 72 onItemBlur_: function(e) { |
| 73 var menu = /** @type {PaperMenuElement} */(this.$$('paper-menu')); | 73 var menu = /** @type {PaperMenuElement} */(this.$$('paper-menu')); |
| 74 if (menu.items.indexOf(e.relatedTarget) >= 0) | 74 if (menu.items.indexOf(e.relatedTarget) >= 0) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 // This can be this.$.more.restoreFocusOnClose = false when this lands: | 77 this.$.more.restoreFocusOnClose = false; |
| 78 // https://github.com/PolymerElements/paper-menu-button/pull/94 | |
| 79 this.$.more.$.dropdown.restoreFocusOnClose = false; | |
| 80 this.closeMoreActions_(); | 78 this.closeMoreActions_(); |
| 81 this.$.more.$.dropdown.restoreFocusOnClose = true; | 79 this.$.more.restoreFocusOnClose = true; |
| 82 }, | 80 }, |
| 83 | 81 |
| 84 /** @private */ | 82 /** @private */ |
| 85 onPaperDropdownOpen_: function() { | 83 onPaperDropdownOpen_: function() { |
| 86 this.boundClose_ = this.boundClose_ || this.closeMoreActions_.bind(this); | 84 this.boundClose_ = this.boundClose_ || this.closeMoreActions_.bind(this); |
| 87 window.addEventListener('resize', this.boundClose_); | 85 window.addEventListener('resize', this.boundClose_); |
| 88 }, | 86 }, |
| 89 | 87 |
| 90 /** | 88 /** |
| 91 * @param {!CustomEvent} event | 89 * @param {!CustomEvent} event |
| (...skipping 18 matching lines...) Expand all Loading... |
| 110 }); | 108 }); |
| 111 | 109 |
| 112 return {Toolbar: Toolbar}; | 110 return {Toolbar: Toolbar}; |
| 113 }); | 111 }); |
| 114 | 112 |
| 115 // TODO(dbeam): https://github.com/PolymerElements/iron-dropdown/pull/16/files | 113 // TODO(dbeam): https://github.com/PolymerElements/iron-dropdown/pull/16/files |
| 116 /** @suppress {checkTypes} */ | 114 /** @suppress {checkTypes} */ |
| 117 (function() { | 115 (function() { |
| 118 Polymer.IronDropdownScrollManager.pushScrollLock = function() {}; | 116 Polymer.IronDropdownScrollManager.pushScrollLock = function() {}; |
| 119 })(); | 117 })(); |
| OLD | NEW |