From f45f250a1d53ca22d2c63b509b882917e4160c88 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 26 May 2021 20:29:41 +0100 Subject: [PATCH] Sorted snippets alphabetically in card menus no issue - more logical ordering --- ghost/admin/app/controllers/editor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/controllers/editor.js b/ghost/admin/app/controllers/editor.js index c2293cd69d..4b213bd164 100644 --- a/ghost/admin/app/controllers/editor.js +++ b/ghost/admin/app/controllers/editor.js @@ -144,8 +144,10 @@ export default Controller.extend({ return this.store.peekAll('snippet'); }), - snippets: computed('_snippets.@each.isNew', function () { - return this._snippets.reject(snippet => snippet.get('isNew')); + snippets: computed('_snippets.@each.{name,isNew}', function () { + return this._snippets + .reject(snippet => snippet.get('isNew')) + .sort((a, b) => a.name.localeCompare(b.name)); }), canManageSnippets: computed('session.user.{isOwnerOrAdmin,isEditor}', function () {