From b41d66214a5fdc414f626b7a8c0571c63ba4d3ca Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Wed, 31 Jul 2019 17:42:50 +1000 Subject: [PATCH] Fix validations --- assets/javascripts/wizard/initializers/custom.js.es6 | 9 +++++---- assets/stylesheets/wizard/wizard_custom.scss | 10 +++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index 22c7e3bf..d2154467 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -73,7 +73,7 @@ export default { animateInvalidFields() { Ember.run.scheduleOnce('afterRender', () => { - $('.invalid input[type=text], .invalid textarea, .invalid input[type=checkbox]').wiggle(2, 100); + $('.invalid input[type=text], .invalid textarea, .invalid input[type=checkbox], .invalid .select-kit').wiggle(2, 100); }); }, @@ -209,9 +209,7 @@ export default { 'textarea', 'dropdown', 'tag', - 'category', 'image', - 'checkbox', 'user-selector', 'text-only', 'composer' @@ -240,11 +238,14 @@ export default { const type = this.get('type'); if (type === 'checkbox') { valid = val; + } else if (type === 'category') { + valid = val && val.toString().length > 0; } else if (StandardFieldValidation.indexOf(type) > -1) { - valid = val && String(val).length > 0; + valid = val && val.length > 0; } } + this.setValid(valid); return valid; diff --git a/assets/stylesheets/wizard/wizard_custom.scss b/assets/stylesheets/wizard/wizard_custom.scss index a1d950cf..ae2ca223 100644 --- a/assets/stylesheets/wizard/wizard_custom.scss +++ b/assets/stylesheets/wizard/wizard_custom.scss @@ -508,9 +508,13 @@ img.avatar { } } -.checkbox-field.invalid .input-area { - padding: 3px; - border: 4px solid red; +.wizard-field { + &.invalid{ + textarea, input[type=text], input[type=checkbox], .select-kit { + padding: 3px; + border: 4px solid red; + } + } } @keyframes rotate-forever {