Footer don't keep room state
This commit is contained in:
@@ -136,8 +136,7 @@ angular.module('app')
|
||||
this.rooms = [];
|
||||
|
||||
modelManager.addItemSyncObserver("room-bar", "SN|Component", (allItems, validItems, deletedItems, source) => {
|
||||
var incomingRooms = allItems.filter((candidate) => {return candidate.area == "rooms"});
|
||||
this.rooms = _.uniq(this.rooms.concat(incomingRooms)).filter((candidate) => {return !candidate.deleted});
|
||||
this.rooms = modelManager.components.filter((candidate) => {return candidate.area == "rooms" && !candidate.deleted});
|
||||
});
|
||||
|
||||
componentManager.registerHandler({identifier: "roomBar", areas: ["rooms", "modal"], activationHandler: (component) => {
|
||||
|
||||
@@ -14,7 +14,7 @@ class ActionsManager {
|
||||
}
|
||||
|
||||
get extensions() {
|
||||
return this.modelManager.extensions;
|
||||
return this.modelManager.validItemsForContentType("Extension");
|
||||
}
|
||||
|
||||
extensionsInContextOfItem(item) {
|
||||
|
||||
@@ -18,7 +18,7 @@ class ModelManager extends SFModelManager {
|
||||
super();
|
||||
this.notes = [];
|
||||
this.tags = [];
|
||||
this._extensions = [];
|
||||
this.components = [];
|
||||
|
||||
this.storageManager = storageManager;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class ModelManager extends SFModelManager {
|
||||
super.resetLocalMemory();
|
||||
this.notes.length = 0;
|
||||
this.tags.length = 0;
|
||||
this._extensions.length = 0;
|
||||
this.components.length = 0;
|
||||
}
|
||||
|
||||
findOrCreateTagByTitle(title) {
|
||||
@@ -58,9 +58,9 @@ class ModelManager extends SFModelManager {
|
||||
if(!_.find(this.notes, {uuid: item.uuid})) {
|
||||
this.notes.unshift(item);
|
||||
}
|
||||
} else if(item.content_type == "Extension") {
|
||||
if(!_.find(this._extensions, {uuid: item.uuid})) {
|
||||
this._extensions.unshift(item);
|
||||
} else if(item.content_type == "SN|Component") {
|
||||
if(!_.find(this.components, {uuid: item.uuid})) {
|
||||
this.components.unshift(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,8 +100,8 @@ class ModelManager extends SFModelManager {
|
||||
_.remove(this.tags, {uuid: item.uuid});
|
||||
} else if(item.content_type == "Note") {
|
||||
_.remove(this.notes, {uuid: item.uuid});
|
||||
} else if(item.content_type == "Extension") {
|
||||
_.remove(this._extensions, {uuid: item.uuid});
|
||||
} else if(item.content_type == "SN|Component") {
|
||||
_.remove(this.components, {uuid: item.uuid});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ class ModelManager extends SFModelManager {
|
||||
return {
|
||||
"Note" : "note",
|
||||
"Tag" : "tag",
|
||||
"SN|SmartTag": "smart tag",
|
||||
"Extension" : "action-based extension",
|
||||
"SN|Component" : "component",
|
||||
"SN|Editor" : "editor",
|
||||
|
||||
Reference in New Issue
Block a user