Fix issue with sort functions
This commit is contained in:
@@ -11,7 +11,9 @@ class ActionsMenu {
|
|||||||
controller($scope, modelManager, actionsManager) {
|
controller($scope, modelManager, actionsManager) {
|
||||||
'ngInject';
|
'ngInject';
|
||||||
|
|
||||||
$scope.extensions = actionsManager.extensions.sort((a, b) => {return a.name.toLowerCase() > b.name.toLowerCase()});
|
$scope.extensions = actionsManager.extensions.sort((a, b) => {
|
||||||
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
for(let ext of $scope.extensions) {
|
for(let ext of $scope.extensions) {
|
||||||
ext.loading = true;
|
ext.loading = true;
|
||||||
|
|||||||
@@ -15,8 +15,13 @@ class EditorMenu {
|
|||||||
|
|
||||||
$scope.formData = {};
|
$scope.formData = {};
|
||||||
|
|
||||||
$scope.editors = componentManager.componentsForArea("editor-editor").sort((a, b) => {return a.name.toLowerCase() > b.name.toLowerCase()});
|
$scope.editors = componentManager.componentsForArea("editor-editor").sort((a, b) => {
|
||||||
$scope.stack = componentManager.componentsForArea("editor-stack").sort((a, b) => {return a.name.toLowerCase() > b.name.toLowerCase()});
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.stack = componentManager.componentsForArea("editor-stack").sort((a, b) => {
|
||||||
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
$scope.isDesktop = isDesktopApplication();
|
$scope.isDesktop = isDesktopApplication();
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,11 @@ class SingletonManager {
|
|||||||
*/
|
*/
|
||||||
if(allExtantItemsMatchingPredicate.length >= 2) {
|
if(allExtantItemsMatchingPredicate.length >= 2) {
|
||||||
let sorted = allExtantItemsMatchingPredicate.sort((a, b) => {
|
let sorted = allExtantItemsMatchingPredicate.sort((a, b) => {
|
||||||
return a.created_at > b.created_at;
|
/*
|
||||||
|
If compareFunction(a, b) is less than 0, sort a to an index lower than b, i.e. a comes first.
|
||||||
|
If compareFunction(a, b) is greater than 0, sort b to an index lower than a, i.e. b comes first.
|
||||||
|
*/
|
||||||
|
return a.created_at < b.created_at ? -1 : 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
// The item that will be chosen to be kept
|
// The item that will be chosen to be kept
|
||||||
|
|||||||
Reference in New Issue
Block a user