Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1806)

Side by Side Diff: chrome/browser/resources/md_downloads/crisper.js

Issue 2167383003: MD Downloads: simplify how we detect focus changes that close the "More actions..." menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@roll-polymer2
Patch Set: merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/toolbar.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 /** 5 /**
6 * @fileoverview Assertion support. 6 * @fileoverview Assertion support.
7 */ 7 */
8 8
9 /** 9 /**
10 * Verify |condition| is truthy and return |condition| if so. 10 * Verify |condition| is truthy and return |condition| if so.
(...skipping 11713 matching lines...) Expand 10 before | Expand all | Expand 10 after
11724 11724
11725 /** 11725 /**
11726 * @param {!Event} e 11726 * @param {!Event} e
11727 * @private 11727 * @private
11728 */ 11728 */
11729 onItemBlur_: function(e) { 11729 onItemBlur_: function(e) {
11730 var menu = /** @type {PaperMenuElement} */(this.$$('paper-menu')); 11730 var menu = /** @type {PaperMenuElement} */(this.$$('paper-menu'));
11731 if (menu.items.indexOf(e.relatedTarget) >= 0) 11731 if (menu.items.indexOf(e.relatedTarget) >= 0)
11732 return; 11732 return;
11733 11733
11734 // This can be this.$.more.restoreFocusOnClose = false when this lands: 11734 this.$.more.restoreFocusOnClose = false;
11735 // https://github.com/PolymerElements/paper-menu-button/pull/94
11736 this.$.more.$.dropdown.restoreFocusOnClose = false;
11737 this.closeMoreActions_(); 11735 this.closeMoreActions_();
11738 this.$.more.$.dropdown.restoreFocusOnClose = true; 11736 this.$.more.restoreFocusOnClose = true;
11739 }, 11737 },
11740 11738
11741 /** @private */ 11739 /** @private */
11742 onPaperDropdownOpen_: function() { 11740 onPaperDropdownOpen_: function() {
11743 this.boundClose_ = this.boundClose_ || this.closeMoreActions_.bind(this); 11741 this.boundClose_ = this.boundClose_ || this.closeMoreActions_.bind(this);
11744 window.addEventListener('resize', this.boundClose_); 11742 window.addEventListener('resize', this.boundClose_);
11745 }, 11743 },
11746 11744
11747 /** 11745 /**
11748 * @param {!CustomEvent} event 11746 * @param {!CustomEvent} event
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
11956 Manager.get().updateItem_(index, data); 11954 Manager.get().updateItem_(index, data);
11957 }; 11955 };
11958 11956
11959 return {Manager: Manager}; 11957 return {Manager: Manager};
11960 }); 11958 });
11961 // Copyright 2015 The Chromium Authors. All rights reserved. 11959 // Copyright 2015 The Chromium Authors. All rights reserved.
11962 // Use of this source code is governed by a BSD-style license that can be 11960 // Use of this source code is governed by a BSD-style license that can be
11963 // found in the LICENSE file. 11961 // found in the LICENSE file.
11964 11962
11965 window.addEventListener('load', downloads.Manager.onLoad); 11963 window.addEventListener('load', downloads.Manager.onLoad);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/md_downloads/toolbar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698