Skip to content

Commit

Permalink
Merge pull request outbrain-inc#149 from github/web-color-by-default
Browse files Browse the repository at this point in the history
colorize-dc is on by default
  • Loading branch information
Shlomi Noach authored Nov 23, 2016
2 parents bdea515 + 7195aed commit d9be66d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions resources/public/js/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ function Cluster() {

main();

function isColorizeDC() {
if ($.cookie("colorize-dc") == "false") {
return false
}
return true
}

function getInstanceDiv(instanceId) {
var popoverDiv = $("#cluster_container > .instance[data-nodeid='" + instanceId + "']");
Expand Down Expand Up @@ -243,7 +249,7 @@ function Cluster() {
trailerEl.getAppend(".instance-trailer-title").text(numReplicasMessage);
trailerEl.getAppend(".instance-trailer-content").text("Drag to move replicas");
}
if ($.cookie("colorize-dc") == "true") {
if (isColorizeDC()) {
var dcColor = dcColorsMap[node.DataCenter];
$(instanceEl).css("border-color", dcColor);
$(instanceEl).css("border-width", 2);
Expand Down Expand Up @@ -1316,7 +1322,7 @@ function Cluster() {
// Colorize-dc
{
var glyph = $("#cluster_sidebar [data-bullet=colorize-dc] .glyphicon");
if ($.cookie("colorize-dc") == "true") {
if (isColorizeDC()) {
glyph.addClass("text-info");
glyph.attr("title", "Disable colors");
} else {
Expand Down Expand Up @@ -1568,7 +1574,7 @@ function Cluster() {
if ($.cookie("anonymize") == "true") {
$("#dropdown-context a[data-command=anonymize]").prepend('<span class="glyphicon glyphicon-ok small"></span> ');
}
if ($.cookie("colorize-dc") == "true") {
if (isColorizeDC()) {
$("#dropdown-context a[data-command=colorize-dc]").prepend('<span class="glyphicon glyphicon-ok small"></span> ');
}
populateSidebar(clusterInfo);
Expand Down Expand Up @@ -1651,7 +1657,7 @@ function Cluster() {
location.reload();
});
$("body").on("click", "a[data-command=colorize-dc]", function(event) {
if ($.cookie("colorize-dc") == "true") {
if (isColorizeDC()) {
$.cookie("colorize-dc", "false", {
path: '/',
expires: 1
Expand Down

0 comments on commit d9be66d

Please sign in to comment.