diff --git a/src/pretix/static/pretixcontrol/js/ui/main.js b/src/pretix/static/pretixcontrol/js/ui/main.js
index 471e792f7..26b0e988d 100644
--- a/src/pretix/static/pretixcontrol/js/ui/main.js
+++ b/src/pretix/static/pretixcontrol/js/ui/main.js
@@ -291,7 +291,7 @@ var form_handlers = function (el) {
maxTop: 200
}
}
- }).on('changeColor create', function (e) {
+ }).not(".no-contrast").on('changeColor create', function (e) {
var rgb = $(this).colorpicker('color').toRGB();
var c = contrast([255,255,255], [rgb.r, rgb.g, rgb.b]);
var mark = 'times';
@@ -302,21 +302,19 @@ var form_handlers = function (el) {
if ($(this).val() === "") {
$note.remove();
}
- if (!$(this).is(".no-contrast")) {
- if (c > 7) {
- $note.html("")
- .append(gettext('Your color has great contrast and is very easy to read!'));
- $note.addClass("text-success").removeClass("text-warning").removeClass("text-danger");
- } else if (c > 2.5) {
- $note.html("")
- .append(gettext('Your color has decent contrast and is probably good-enough to read!'));
- $note.removeClass("text-success").removeClass("text-warning").removeClass("text-danger");
- } else {
- $note.html("")
- .append(gettext('Your color has bad contrast for text on white background, please choose a darker ' +
- 'shade.'));
- $note.addClass("text-danger").removeClass("text-success").removeClass("text-warning");
- }
+ if (c > 7) {
+ $note.html("")
+ .append(gettext('Your color has great contrast and is very easy to read!'));
+ $note.addClass("text-success").removeClass("text-warning").removeClass("text-danger");
+ } else if (c > 2.5) {
+ $note.html("")
+ .append(gettext('Your color has decent contrast and is probably good-enough to read!'));
+ $note.removeClass("text-success").removeClass("text-warning").removeClass("text-danger");
+ } else {
+ $note.html("")
+ .append(gettext('Your color has bad contrast for text on white background, please choose a darker ' +
+ 'shade.'));
+ $note.addClass("text-danger").removeClass("text-success").removeClass("text-warning");
}
});