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

Side by Side Diff: chrome/browser/resources/settings/about_page/detailed_build_info.js

Issue 2803853002: MD Settings: Restore focus when channel switcher dialog is closed. (Closed)
Patch Set: Created 3 years, 8 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 | « chrome/browser/resources/settings/about_page/detailed_build_info.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 'settings-detailed-build-info' contains detailed build 6 * @fileoverview 'settings-detailed-build-info' contains detailed build
7 * information for ChromeOS. 7 * information for ChromeOS.
8 */ 8 */
9 9
10 Polymer({ 10 Polymer({
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 CrPolicyIndicatorType.OWNER; 82 CrPolicyIndicatorType.OWNER;
83 }, 83 },
84 84
85 /** 85 /**
86 * @param {!Event} e 86 * @param {!Event} e
87 * @private 87 * @private
88 */ 88 */
89 onChangeChannelTap_: function(e) { 89 onChangeChannelTap_: function(e) {
90 e.preventDefault(); 90 e.preventDefault();
91 this.showChannelSwitcherDialog_ = true; 91 this.showChannelSwitcherDialog_ = true;
92 // Async to wait for dialog to appear in the DOM. 92 },
93 this.async(function() { 93
94 var dialog = this.$$('settings-channel-switcher-dialog'); 94 /** @private */
95 // Register listener to detect when the dialog is closed. Flip the boolean 95 onChannelSwitcherDialogClosed_: function() {
96 // once closed to force a restamp next time it is shown such that the 96 this.showChannelSwitcherDialog_ = false;
97 // previous dialog's contents are cleared. 97 this.$$('paper-button').focus();
98 dialog.addEventListener('close', function() { 98 this.updateChannelInfo_();
stevenjb 2017/04/06 23:08:06 Ahh, much nicer :) Cheers!
99 this.showChannelSwitcherDialog_ = false;
100 this.updateChannelInfo_();
101 }.bind(this));
102 }.bind(this));
103 }, 99 },
104 }); 100 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/about_page/detailed_build_info.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698