mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
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:
parent
76f09b1e49
commit
213e38c2ef
105 changed files with 2165 additions and 2408 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue