Chromium Code Reviews| Index: chrome/browser/resources/md_downloads/toolbar.js |
| diff --git a/chrome/browser/resources/md_downloads/toolbar.js b/chrome/browser/resources/md_downloads/toolbar.js |
| index 2c586881218adb9192fff4c02ce379b3c7be6684..8140d43f674ebf287b06ddec63ee1170258a414f 100644 |
| --- a/chrome/browser/resources/md_downloads/toolbar.js |
| +++ b/chrome/browser/resources/md_downloads/toolbar.js |
| @@ -45,9 +45,8 @@ cr.define('downloads', function() { |
| }, |
| /** @private */ |
| - onClearAllTap_: function() { |
| - assert(this.canClearAll()); |
| - downloads.ActionService.getInstance().clearAll(); |
| + closeMoreActions_: function(e) { |
|
tsergeant
2016/07/18 01:53:19
You need to get rid of this `e` to fix the compile
Dan Beam
2016/07/18 07:09:40
Done.
|
| + this.$.more.close(); |
| }, |
| /** @private */ |
| @@ -56,16 +55,35 @@ cr.define('downloads', function() { |
| }, |
| /** @private */ |
| + onClearAllTap_: function() { |
| + assert(this.canClearAll()); |
| + downloads.ActionService.getInstance().clearAll(); |
| + }, |
| + |
| + /** @private */ |
| onPaperDropdownClose_: function() { |
| - window.removeEventListener('resize', assert(this.boundResize_)); |
| + window.removeEventListener('resize', assert(this.boundClose_)); |
| + }, |
| + |
| + /** |
| + * @param {!Event} e |
| + * @private |
| + */ |
| + onItemBlur_: function(e) { |
| + if (this.$$('paper-menu').items.indexOf(e.relatedTarget) >= 0) |
| + return; |
| + |
| + // This can be this.$.more.restoreFocusOnClose = false when this lands: |
| + // https://github.com/PolymerElements/paper-menu-button/pull/94 |
| + this.$.more.$.dropdown.restoreFocusOnClose = false; |
| + this.closeMoreActions_(); |
| + this.$.more.$.dropdown.restoreFocusOnClose = true; |
| }, |
| /** @private */ |
| onPaperDropdownOpen_: function() { |
| - this.boundResize_ = this.boundResize_ || function() { |
| - this.$.more.close(); |
| - }.bind(this); |
| - window.addEventListener('resize', this.boundResize_); |
| + this.boundClose_ = this.boundClose_ || this.closeMoreActions_.bind(this); |
| + window.addEventListener('resize', this.boundClose_); |
| }, |
| /** |