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

Unified Diff: chrome/browser/resources/settings/device_page/display_overscan_dialog.js

Issue 2371993002: MD Settings: Display: Move event listeners to dialog open/close (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/device_page/display_overscan_dialog.js
diff --git a/chrome/browser/resources/settings/device_page/display_overscan_dialog.js b/chrome/browser/resources/settings/device_page/display_overscan_dialog.js
index 4cb019fcabdedb1d74e988030345aaf1032ed325..885ad80a5b861e7ad5e0653352b42d67f5e67031 100644
--- a/chrome/browser/resources/settings/device_page/display_overscan_dialog.js
+++ b/chrome/browser/resources/settings/device_page/display_overscan_dialog.js
@@ -30,23 +30,16 @@ Polymer({
*/
keyHandler_: null,
- /** @override */
- attached: function() {
+ open: function() {
this.keyHandler_ = this.handleKeyEvent_.bind(this);
window.addEventListener('keydown', this.keyHandler_);
Dan Beam 2016/09/27 00:04:52 why are we using window.addEventListener() rather
stevenjb 2016/09/28 17:49:35 Because I'm still fairly new to web development an
- },
-
- /** @override */
- detached: function() {
- window.removeEventListener('keydown', this.keyHandler_);
- },
-
- open: function() {
this.comitted_ = false;
this.$.dialog.showModal();
},
close: function() {
+ window.removeEventListener('keydown', this.keyHandler_);
+
this.displayId = ''; // Will trigger displayIdChanged_.
if (this.$.dialog.open)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698