[gnome-shell] Bind "this" for various methods
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Bind "this" for various methods
- Date: Wed, 11 Sep 2013 19:02:51 +0000 (UTC)
commit 2d8ed4c77ff54cece41edbfd66239c5514857ec4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Sep 10 21:53:19 2013 -0400
Bind "this" for various methods
For extremely silly reasons with how the class framework works, the wrapper
method requires "this" to be bound in order for it to work, or else we'll
emit errors in strict mode.
https://bugzilla.gnome.org/show_bug.cgi?id=707892
js/ui/appDisplay.js | 2 +-
js/ui/status/network.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index e0a4182..6d4586e 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -125,7 +125,7 @@ const BaseAppView = new Lang.Class({
},
loadGrid: function() {
- this._allItems.sort(this._compareItems);
+ this._allItems.sort(Lang.bind(this, this._compareItems));
for (let i = 0; i < this._allItems.length; i++) {
let id = this._getItemId(this._allItems[i]);
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 879d7bf..029c4ca 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -244,7 +244,7 @@ const NMConnectionSection = new Lang.Class({
this.emit('activation-failed', reason);
}));
- let pos = Util.insertSorted(this._connections, connection, this._connectionSortFunction);
+ let pos = Util.insertSorted(this._connections, connection, Lang.bind(this,
this._connectionSortFunction));
this._labelSection.addMenuItem(item.labelItem, pos);
this._switchSection.addMenuItem(item.switchItem, pos);
this._connectionItems.set(connection.get_uuid(), item);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]