Reload theme dock logic
This commit is contained in:
@@ -138,20 +138,22 @@ angular.module('app')
|
|||||||
|
|
||||||
this.componentManager = componentManager;
|
this.componentManager = componentManager;
|
||||||
this.rooms = [];
|
this.rooms = [];
|
||||||
this.themes = [];
|
this.themesWithIcons = [];
|
||||||
|
|
||||||
modelManager.addItemSyncObserver("room-bar", "SN|Component", (allItems, validItems, deletedItems, source) => {
|
modelManager.addItemSyncObserver("room-bar", "SN|Component", (allItems, validItems, deletedItems, source) => {
|
||||||
this.rooms = modelManager.components.filter((candidate) => {return candidate.area == "rooms" && !candidate.deleted});
|
this.rooms = modelManager.components.filter((candidate) => {return candidate.area == "rooms" && !candidate.deleted});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelManager.addItemSyncObserver("footer-bar-themes", "SN|Theme", (allItems, validItems, deletedItems, source) => {
|
modelManager.addItemSyncObserver("footer-bar-themes", "SN|Theme", (allItems, validItems, deletedItems, source) => {
|
||||||
let themes = modelManager.validItemsForContentType("SN|Theme").filter((candidate) => {return !candidate.deleted}).sort((a, b) => {
|
let themes = modelManager.validItemsForContentType("SN|Theme").filter((candidate) => {
|
||||||
|
return !candidate.deleted && candidate.content.package_info.dock_icon;
|
||||||
|
}).sort((a, b) => {
|
||||||
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
let differ = themes.length != this.themes.length;
|
let differ = themes.length != this.themesWithIcons.length;
|
||||||
|
|
||||||
this.themes = themes;
|
this.themesWithIcons = themes;
|
||||||
|
|
||||||
if(differ) {
|
if(differ) {
|
||||||
this.reloadDockShortcuts();
|
this.reloadDockShortcuts();
|
||||||
@@ -160,7 +162,7 @@ angular.module('app')
|
|||||||
|
|
||||||
this.reloadDockShortcuts = function() {
|
this.reloadDockShortcuts = function() {
|
||||||
let shortcuts = [];
|
let shortcuts = [];
|
||||||
for(var theme of this.themes) {
|
for(var theme of this.themesWithIcons) {
|
||||||
var icon = theme.content.package_info.dock_icon;
|
var icon = theme.content.package_info.dock_icon;
|
||||||
if(!icon) {
|
if(!icon) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "standard-notes-web",
|
"name": "standard-notes-web",
|
||||||
"version": "3.0.0-beta1",
|
"version": "3.0.0-beta3",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Reference in New Issue
Block a user