cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base to bind `this` to anonymous functions, replacing the more overbose Lang.bind(this, function() {}). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
This commit is contained in:

committed by
Florian Müllner

parent
76f09b1e49
commit
213e38c2ef
js
extensionPrefs
gdm
misc
ibusManager.jsinputMethod.jsjsParse.jskeyboardManager.jsloginManager.jsmodemManager.jsobjectManager.jssmartcardManager.jssystemActions.jsutil.js
perf
portalHelper
ui
altTab.jsappDisplay.jsappFavorites.jsaudioDeviceSelection.jsbackground.jsbackgroundMenu.jsboxpointer.jscalendar.jscloseDialog.js
components
ctrlAltTab.jsdash.jsdateMenu.jsdnd.jsedgeDragAction.jsendSessionDialog.jsenvironment.jsextensionDownloader.jsextensionSystem.jsgrabHelper.jsibusCandidatePopup.jsiconGrid.jskeyboard.jslayout.jslightbox.jslookingGlass.jsmagnifier.jsmagnifierDBus.jsmain.jsmessageList.jsmessageTray.jsmodalDialog.jsmpris.jsnotificationDaemon.jsosdMonitorLabeler.jsosdWindow.jsoverview.jsoverviewControls.jspadOsd.jspanel.jspanelMenu.jspopupMenu.jsremoteMenu.jsremoteSearch.jsrunDialog.jsscreenShield.jsscreenshot.jsscripting.jssearch.jssessionMode.jsshellDBus.jsshellEntry.jsshellMountOperation.jsstatus
accessibility.jsbluetooth.jsbrightness.jskeyboard.jslocation.jsnetwork.jspower.jsrfkill.jssystem.jsthunderbolt.jsvolume.js
switcherPopup.jstweener.jsviewSelector.jswindowAttentionHandler.jswindowManager.jswindowMenu.jsworkspace.jsworkspaceSwitcherPopup.jsworkspaceThumbnail.jsworkspacesView.jstests
@ -47,7 +47,7 @@ var RemoteMenuSeparatorItemMapper = new Lang.Class({
|
||||
this._trackerItem.connect('notify::label', Lang.bind(this, this._updateLabel));
|
||||
this._updateLabel();
|
||||
|
||||
this.menuItem.connect('destroy', function() {
|
||||
this.menuItem.connect('destroy', () => {
|
||||
trackerItem.run_dispose();
|
||||
});
|
||||
},
|
||||
@ -89,15 +89,15 @@ var RemoteMenuSubmenuItemMapper = new Lang.Class({
|
||||
_insertItem.bind(null, this.menuItem.menu),
|
||||
_removeItem.bind(null, this.menuItem.menu));
|
||||
|
||||
this.menuItem.connect('request-open', Lang.bind(this, function(menu, open) {
|
||||
this.menuItem.connect('request-open', (menu, open) => {
|
||||
this._trackerItem.request_submenu_shown(open);
|
||||
}));
|
||||
});
|
||||
|
||||
this._trackerItem.connect('notify::submenu-shown', Lang.bind(this, function() {
|
||||
this._trackerItem.connect('notify::submenu-shown', () => {
|
||||
this.menuItem.setSubmenuShown(this._trackerItem.get_submenu_shown());
|
||||
}));
|
||||
});
|
||||
|
||||
this.menuItem.connect('destroy', function() {
|
||||
this.menuItem.connect('destroy', () => {
|
||||
trackerItem.run_dispose();
|
||||
});
|
||||
},
|
||||
@ -123,9 +123,9 @@ var RemoteMenuItemMapper = new Lang.Class({
|
||||
this.menuItem.actor.add_child(this._label);
|
||||
this.menuItem.actor.label_actor = this._label;
|
||||
|
||||
this.menuItem.connect('activate', Lang.bind(this, function() {
|
||||
this.menuItem.connect('activate', () => {
|
||||
this._trackerItem.activated();
|
||||
}));
|
||||
});
|
||||
|
||||
this._trackerItem.bind_property('visible', this.menuItem.actor, 'visible', GObject.BindingFlags.SYNC_CREATE);
|
||||
|
||||
@ -138,7 +138,7 @@ var RemoteMenuItemMapper = new Lang.Class({
|
||||
this._updateSensitivity();
|
||||
this._updateRole();
|
||||
|
||||
this.menuItem.connect('destroy', function() {
|
||||
this.menuItem.connect('destroy', () => {
|
||||
trackerItem.run_dispose();
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user