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
@ -40,7 +40,7 @@ function addBackgroundMenu(actor, layoutManager) {
|
||||
}
|
||||
|
||||
let clickAction = new Clutter.ClickAction();
|
||||
clickAction.connect('long-press', function(action, actor, state) {
|
||||
clickAction.connect('long-press', (action, actor, state) => {
|
||||
if (state == Clutter.LongPressState.QUERY)
|
||||
return ((action.get_button() == 0 ||
|
||||
action.get_button() == 1) &&
|
||||
@ -52,7 +52,7 @@ function addBackgroundMenu(actor, layoutManager) {
|
||||
}
|
||||
return true;
|
||||
});
|
||||
clickAction.connect('clicked', function(action) {
|
||||
clickAction.connect('clicked', action => {
|
||||
if (action.get_button() == 3) {
|
||||
let [x, y] = action.get_coords();
|
||||
openMenu(x, y);
|
||||
@ -60,11 +60,11 @@ function addBackgroundMenu(actor, layoutManager) {
|
||||
});
|
||||
actor.add_action(clickAction);
|
||||
|
||||
let grabOpBeginId = global.display.connect('grab-op-begin', function () {
|
||||
let grabOpBeginId = global.display.connect('grab-op-begin', () => {
|
||||
clickAction.release();
|
||||
});
|
||||
|
||||
actor.connect('destroy', function() {
|
||||
actor.connect('destroy', () => {
|
||||
actor._backgroundMenu.destroy();
|
||||
actor._backgroundMenu = null;
|
||||
actor._backgroundManager = null;
|
||||
|
Reference in New Issue
Block a user