From 94910e25f05ed42817534b09c498e0d039d9cb23 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Sun, 4 Feb 2018 17:23:28 +0800 Subject: [PATCH] Ensure invalid checkbox is animated --- assets/javascripts/wizard/initializers/custom.js.es6 | 6 ++++++ assets/stylesheets/wizard/wizard_custom.scss | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index 11f9f108..7c4b3b90 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -41,6 +41,12 @@ export default { WizardStep.reopen({ classNameBindings: ['step.id'], + animateInvalidFields() { + Ember.run.scheduleOnce('afterRender', () => { + $('.invalid input[type=text], .invalid textarea, .invalid input[type=checkbox]').wiggle(2, 100); + }); + }, + ensureStartsAtTop: function() { window.scrollTo(0,0); }.observes('step.id'), diff --git a/assets/stylesheets/wizard/wizard_custom.scss b/assets/stylesheets/wizard/wizard_custom.scss index c1ebb713..2490b9b2 100644 --- a/assets/stylesheets/wizard/wizard_custom.scss +++ b/assets/stylesheets/wizard/wizard_custom.scss @@ -408,6 +408,11 @@ img.avatar { } } +.checkbox-field.invalid .input-area { + padding: 3px; + border: 4px solid red; +} + @keyframes rotate-forever { 0% { transform: rotate(0deg);