Commit f1c666e5 authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

MainMenu: updated visuals

parent 20e18380
...@@ -27,23 +27,23 @@ define([ ...@@ -27,23 +27,23 @@ define([
var wsExtra = { var wsExtra = {
divider: { divider: {
divider: true, divider: true,
position: -1, position: 10,
}, },
configure: { configure: {
iconClass: "fa-wrench fa-fw", iconClass: "fa-wrench fa-fw",
label: "Configure", label: "Configure",
position: 10, position: 30,
}, },
add: { add: {
iconClass: "fa-plus fa-fw", iconClass: "fa-plus fa-fw",
label: "Add", label: "Add",
hidden: false, hidden: false,
position: 20, position: 0,
}, },
disconnectAll: { disconnectAll: {
iconClass: "fa-eject fa-fw", iconClass: "fa-eject fa-fw",
label: "Disconnect all", label: "Disconnect all",
position: 30, position: 20,
disabled: function() { disabled: function() {
return !this.$root.wsAnyConnected; return !this.$root.wsAnyConnected;
}, },
...@@ -53,17 +53,6 @@ define([ ...@@ -53,17 +53,6 @@ define([
}, },
}; };
var state2Icon = function(state) {
switch (state) {
case "connected":
return "fa-check";
case "disconnected":
return "";
default:
return "fa-refresh fa-spin";
}
};
var MainMenuItem = Menu.item.extend({ var MainMenuItem = Menu.item.extend({
computed: { computed: {
disabled: { disabled: {
...@@ -98,9 +87,14 @@ define([ ...@@ -98,9 +87,14 @@ define([
(this.hasSubmenu ? " dropdown-submenu" : ""); (this.hasSubmenu ? " dropdown-submenu" : "");
}, },
iconClass: function() { iconClass: function() {
if (this.current && this.data.state == "connected") switch (this.data.state) {
return "fa-fw fa-chevron-right"; case "connected":
return "fa-fw " + state2Icon(this.data.state); return "fa-fw " + (this.current ? "fa-circle" : "fa-circle-o");
case "disconnected":
return "fa-fw";
default:
return "fa-fw fa-refresh fa-spin";
}
}, },
}, },
methods: { methods: {
...@@ -139,7 +133,14 @@ define([ ...@@ -139,7 +133,14 @@ define([
return this.wsData.current ? this.wsData.workspaces[this.wsData.current].state : ""; return this.wsData.current ? this.wsData.workspaces[this.wsData.current].state : "";
}, },
wsStateIcon: function() { wsStateIcon: function() {
return state2Icon(this.currentState) || "fa-bolt"; switch (this.currentState) {
case "connected":
return "fa-fw fa-check";
case "disconnected":
return "fa-fw fa-bolt";
default:
return "fa-fw fa-server";
}
}, },
wsClass: function() { wsClass: function() {
return "dropdown-submenu ws-menu state-" + (this.currentState || "none"); return "dropdown-submenu ws-menu state-" + (this.currentState || "none");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment