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

Unified Diff: chrome/browser/resources/settings/settings_ui/settings_ui.js

Issue 2984843003: MD Settings: Convert all usages of .bind(this) to use ES6 arrow function. (Closed)
Patch Set: Resolve conflicts. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/settings_ui/settings_ui.js
diff --git a/chrome/browser/resources/settings/settings_ui/settings_ui.js b/chrome/browser/resources/settings/settings_ui/settings_ui.js
index 351433de1ffeb6674171baf06732a9f7c0262caa..187217c653fcb2cb2043c6eba1f772895353843d 100644
--- a/chrome/browser/resources/settings/settings_ui/settings_ui.js
+++ b/chrome/browser/resources/settings/settings_ui/settings_ui.js
@@ -85,13 +85,13 @@ Polymer({
*/
ready: function() {
// Lazy-create the drawer the first time it is opened or swiped into view.
- listenOnce(this.$.drawer, 'open-changed', function() {
+ listenOnce(this.$.drawer, 'open-changed', () => {
this.$.drawerTemplate.if = true;
- }.bind(this));
+ });
- window.addEventListener('popstate', function(e) {
+ window.addEventListener('popstate', e => {
this.$.drawer.closeDrawer();
- }.bind(this));
+ });
CrPolicyStrings = {
controlledSettingExtension:
@@ -137,13 +137,13 @@ Polymer({
this.havePlayStoreApp_ = loadTimeData.valueExists('havePlayStoreApp') &&
loadTimeData.getBoolean('havePlayStoreApp');
- this.addEventListener('show-container', function() {
+ this.addEventListener('show-container', () => {
this.$.container.style.visibility = 'visible';
- }.bind(this));
+ });
- this.addEventListener('hide-container', function() {
+ this.addEventListener('hide-container', () => {
this.$.container.style.visibility = 'hidden';
- }.bind(this));
+ });
},
/** @private {?IntersectionObserver} */
@@ -164,10 +164,10 @@ Polymer({
settings.setGlobalScrollTarget(this.$.container);
// Setup drop shadow logic.
- var callback = function(entries) {
+ var callback = entries => {
this.$.dropShadow.classList.toggle(
'has-shadow', entries[entries.length - 1].intersectionRatio == 0);
- }.bind(this);
+ };
this.intersectionObserver_ = new IntersectionObserver(
callback,
@@ -259,9 +259,9 @@ Polymer({
this.$.container.setAttribute('tabindex', '-1');
this.$.container.focus();
- listenOnce(this.$.container, ['blur', 'pointerdown'], function() {
+ listenOnce(this.$.container, ['blur', 'pointerdown'], () => {
this.$.container.removeAttribute('tabindex');
- }.bind(this));
+ });
},
/** @private */

Powered by Google App Engine
This is Rietveld 408576698