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
@ -321,8 +321,8 @@ function test() {
|
||||
scrollView.set_policy(Gtk.PolicyType[hpolicy.label], Gtk.PolicyType[vpolicy.label]);
|
||||
}
|
||||
|
||||
hpolicy.connect('clicked', function() { togglePolicy(hpolicy); });
|
||||
vpolicy.connect('clicked', function() { togglePolicy(vpolicy); });
|
||||
hpolicy.connect('clicked', () => { togglePolicy(hpolicy); });
|
||||
vpolicy.connect('clicked', () => { togglePolicy(vpolicy); });
|
||||
|
||||
let fadeBox = new St.BoxLayout({ vertical: false });
|
||||
mainBox.add(fadeBox);
|
||||
@ -361,7 +361,7 @@ function test() {
|
||||
scrollView.style += (button.label == 'Yes' ? 'padding: 10px;' : 'padding: 0;');
|
||||
}
|
||||
|
||||
paddingButton.connect('clicked', function() { togglePadding(paddingButton); });
|
||||
paddingButton.connect('clicked', () => { togglePadding(paddingButton); });
|
||||
|
||||
function toggleBorders(button) {
|
||||
switch(button.label) {
|
||||
@ -378,7 +378,7 @@ function test() {
|
||||
scrollView.style += (button.label == 'Yes' ? 'border: 2px solid red;' : 'border: 0;');
|
||||
}
|
||||
|
||||
borderButton.connect('clicked', function() { toggleBorders(borderButton); });
|
||||
borderButton.connect('clicked', () => { toggleBorders(borderButton); });
|
||||
|
||||
function toggleFade(button) {
|
||||
switch(button.label) {
|
||||
@ -392,7 +392,7 @@ function test() {
|
||||
scrollView.set_style_class_name(button.label == 'Yes' ? 'vfade' : '');
|
||||
}
|
||||
|
||||
vfade.connect('clicked', function() { toggleFade(vfade); });
|
||||
vfade.connect('clicked', () => { toggleFade(vfade); });
|
||||
toggleFade(vfade);
|
||||
|
||||
function toggleOverlay(button) {
|
||||
@ -407,7 +407,7 @@ function test() {
|
||||
scrollView.overlay_scrollbars = (button.label == 'Yes');
|
||||
}
|
||||
|
||||
overlay.connect('clicked', function() { toggleOverlay(overlay); });
|
||||
overlay.connect('clicked', () => { toggleOverlay(overlay); });
|
||||
|
||||
UI.main(stage);
|
||||
}
|
||||
|
Reference in New Issue
Block a user