mirror of
https://github.com/laurent22/joplin.git
synced 2025-04-26 12:02:59 +02:00
Desktop: Regression: Fix sort tags alphabetically in side-menu (#3489)
This commit is contained in:
parent
282f6de1a9
commit
10ff43f4f0
@ -1,5 +1,6 @@
|
|||||||
const BaseItem = require('lib/models/BaseItem');
|
const BaseItem = require('lib/models/BaseItem');
|
||||||
const BaseModel = require('lib/BaseModel');
|
const BaseModel = require('lib/BaseModel');
|
||||||
|
const Tag = require('lib/models/Tag');
|
||||||
|
|
||||||
const shared = {};
|
const shared = {};
|
||||||
|
|
||||||
@ -65,6 +66,13 @@ shared.renderFolders = function(props, renderItem) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
shared.renderTags = function(props, renderItem) {
|
shared.renderTags = function(props, renderItem) {
|
||||||
|
props = Object.assign({}, props);
|
||||||
|
const tags = props.tags.slice();
|
||||||
|
// Sort tags alphabetically
|
||||||
|
tags.sort((a, b) => {
|
||||||
|
return Tag.getCachedFullTitle(a.id) < Tag.getCachedFullTitle(b.id) ? -1 : 1;
|
||||||
|
});
|
||||||
|
props.tags = tags;
|
||||||
return renderItemsRecursive_(props, renderItem, [], '', 0, [], BaseModel.TYPE_TAG);
|
return renderItemsRecursive_(props, renderItem, [], '', 0, [], BaseModel.TYPE_TAG);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user