Skip to content

Commit

Permalink
display compared to field only if we actually compare a value
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Jan 16, 2014
1 parent aa57166 commit 680a234
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions javascripts/alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ var CustomAlerts = (function($) {
var isPercentageCondition = condition && 0 === condition.indexOf('percentage_');
var isPercentageMetric = metric && -1 !== metric.indexOf('_rate');
var isSecondsMetric = metric && -1 !== metric.indexOf('_time_');
var isComparedToMetric = condition && -1 !== condition.indexOf('_more_than');

if (isPercentageCondition || isPercentageMetric) {
$('.metricValueDescription').show();
Expand All @@ -206,6 +207,13 @@ var CustomAlerts = (function($) {
} else {
$('.metricValueDescription').hide();
}

if (isComparedToMetric) {
$('.comparedToField').show();
} else {
$('.comparedToField').hide();
}

}

function deleteAlert(alertId)
Expand Down

0 comments on commit 680a234

Please sign in to comment.