Refresh of container icon+name into the awesome bar

This commit is contained in:
baku
2017-01-22 18:44:26 +01:00
parent 72ec2a5731
commit bed0a23c78
2 changed files with 96 additions and 37 deletions
+14 -2
View File
@@ -420,8 +420,8 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
method: identity.userContextId ? "updateIdentity" : "createIdentity",
userContextId: identity.userContextId || 0,
name: document.getElementById("edit-container-panel-name-input").value || Logic.generateIdentityName(),
icon: identity.image || "fingerprint",
color: identity.color || "green",
icon: this._randomIcon(),
color: this._randomColor(),
}).then(() => {
return Logic.refreshIdentities();
}).then(() => {
@@ -441,6 +441,18 @@ Logic.registerPanel(P_CONTAINER_EDIT, {
return Promise.resolve(null);
},
// These 2 methods are for debugging only. We should remove them when we
// finish the UI.
_randomIcon() {
const images = ["fingerprint", "briefcase", "dollar", "cart", "cirlce"];
return images[Math.floor(Math.random() * images.length)];
},
_randomColor() {
const colors = ["blue", "turquoise", "green", "yellow", "orange", "red", "pink", "purple" ];
return colors[Math.floor(Math.random() * colors.length)];
},
});
// P_CONTAINER_DELETE: Delete a container.