[gnome-shell/gbsneto/custom-icon-positions: 6/17] appDisplay: Bind compare function
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/custom-icon-positions: 6/17] appDisplay: Bind compare function
- Date: Wed, 24 Jun 2020 14:35:16 +0000 (UTC)
commit dc78d64acbb403a0fa29c8e22b6c5c1f424f4350
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue May 26 01:40:44 2020 -0300
appDisplay: Bind compare function
So that we can use 'this' inside the compare functions.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1284
js/ui/appDisplay.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index a0c2246f1c..2aa979c3c5 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -301,7 +301,7 @@ var BaseAppView = GObject.registerClass({
let oldApps = this._orderedItems.slice();
let oldAppIds = oldApps.map(icon => icon.id);
- let newApps = this._loadApps().sort(this._compareItems);
+ let newApps = this._loadApps().sort(this._compareItems.bind(this));
let newAppIds = newApps.map(icon => icon.id);
let addedApps = newApps.filter(icon => !oldAppIds.includes(icon.id));
@@ -693,7 +693,7 @@ class AppDisplay extends BaseAppView {
// supposed to be and reinsert it where it's sorted.
let oldIdx = this._orderedItems.indexOf(item);
this._orderedItems.splice(oldIdx, 1);
- let newIdx = Util.insertSorted(this._orderedItems, item, this._compareItems);
+ let newIdx = Util.insertSorted(this._orderedItems, item, this._compareItems.bind(this));
this._grid.removeItem(item);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]