diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index e0a4182a1..6d4586e08 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 879d7bfa1..029c4ca90 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);