cleanup: Use method syntax
Modern javascript has a short-hand for function properties, embrace it for better readability and to prepare for an eventual port to ES6 classes. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
This commit is contained in:

committed by
Florian Müllner

parent
cff0b81f32
commit
76f09b1e49
@ -24,7 +24,7 @@ const RfkillManagerProxy = Gio.DBusProxy.makeProxyWrapper(RfkillManagerInterface
|
||||
var RfkillManager = new Lang.Class({
|
||||
Name: 'RfkillManager',
|
||||
|
||||
_init: function() {
|
||||
_init() {
|
||||
this._proxy = new RfkillManagerProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
|
||||
Lang.bind(this, function(proxy, error) {
|
||||
if (error) {
|
||||
@ -53,7 +53,7 @@ var RfkillManager = new Lang.Class({
|
||||
return this._proxy.ShouldShowAirplaneMode;
|
||||
},
|
||||
|
||||
_changed: function() {
|
||||
_changed() {
|
||||
this.emit('airplane-mode-changed');
|
||||
}
|
||||
});
|
||||
@ -72,7 +72,7 @@ var Indicator = new Lang.Class({
|
||||
Name: 'RfkillIndicator',
|
||||
Extends: PanelMenu.SystemIndicator,
|
||||
|
||||
_init: function() {
|
||||
_init() {
|
||||
this.parent();
|
||||
|
||||
this._manager = getRfkillManager();
|
||||
@ -97,12 +97,12 @@ var Indicator = new Lang.Class({
|
||||
this._sessionUpdated();
|
||||
},
|
||||
|
||||
_sessionUpdated: function() {
|
||||
_sessionUpdated() {
|
||||
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
|
||||
this.menu.setSensitive(sensitive);
|
||||
},
|
||||
|
||||
_sync: function() {
|
||||
_sync() {
|
||||
let airplaneMode = this._manager.airplaneMode;
|
||||
let hwAirplaneMode = this._manager.hwAirplaneMode;
|
||||
let showAirplaneMode = this._manager.shouldShowAirplaneMode;
|
||||
|
Reference in New Issue
Block a user