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

Side by Side Diff: chrome/browser/resources/settings/languages_page/languages_page.js

Issue 2557073003: Call preventDefault in all on-tap events that show a dialog. (Closed)
Patch Set: nit Created 4 years 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
OLDNEW
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 /** 5 /**
6 * @fileoverview 'settings-languages-page' is the settings page 6 * @fileoverview 'settings-languages-page' is the settings page
7 * for language and input method settings. 7 * for language and input method settings.
8 */ 8 */
9 (function() { 9 (function() {
10 'use strict'; 10 'use strict';
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 }, 61 },
62 62
63 /** @private */ 63 /** @private */
64 onBackTap_: function() { 64 onBackTap_: function() {
65 this.$.pages.back(); 65 this.$.pages.back();
66 }, 66 },
67 67
68 /** 68 /**
69 * Stamps and opens the Add Languages dialog, registering a listener to 69 * Stamps and opens the Add Languages dialog, registering a listener to
70 * disable the dialog's dom-if again on close. 70 * disable the dialog's dom-if again on close.
71 * @param {!Event} e
71 * @private 72 * @private
72 */ 73 */
73 onAddLanguagesTap_: function() { 74 onAddLanguagesTap_: function(e) {
75 e.preventDefault();
74 this.showAddLanguagesDialog_ = true; 76 this.showAddLanguagesDialog_ = true;
75 this.async(function() { 77 this.async(function() {
76 var dialog = this.$$('settings-add-languages-dialog'); 78 var dialog = this.$$('settings-add-languages-dialog');
77 dialog.addEventListener('close', function() { 79 dialog.addEventListener('close', function() {
78 this.showAddLanguagesDialog_ = false; 80 this.showAddLanguagesDialog_ = false;
79 }.bind(this)); 81 }.bind(this));
80 }); 82 });
81 }, 83 },
82 84
83 /** 85 /**
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 if (e.target.tagName == expandButtonTag) 513 if (e.target.tagName == expandButtonTag)
512 return; 514 return;
513 515
514 /** @type {!CrExpandButtonElement} */ 516 /** @type {!CrExpandButtonElement} */
515 var expandButton = e.currentTarget.querySelector(expandButtonTag); 517 var expandButton = e.currentTarget.querySelector(expandButtonTag);
516 assert(expandButton); 518 assert(expandButton);
517 expandButton.expanded = !expandButton.expanded; 519 expandButton.expanded = !expandButton.expanded;
518 }, 520 },
519 }); 521 });
520 })(); 522 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698