Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-29 12:20:27 +01:00
Update error handling
Dieser Commit ist enthalten in:
Ursprung
ebab021916
Commit
bab2c95cfe
1 geänderte Dateien mit 9 neuen und 8 gelöschten Zeilen
|
@ -89,15 +89,15 @@ export default {
|
||||||
|
|
||||||
animateInvalidFields() {
|
animateInvalidFields() {
|
||||||
Ember.run.scheduleOnce('afterRender', () => {
|
Ember.run.scheduleOnce('afterRender', () => {
|
||||||
let query = '.invalid input[type=text], .invalid textarea, .invalid input[type=checkbox], .invalid .select-kit';
|
let $element = $('.invalid input[type=text], .invalid textarea, .invalid input[type=checkbox], .invalid .select-kit');
|
||||||
let $element = $(query);
|
|
||||||
let scrollTop = $(query).length ? $(query).offset().top - 200 : 0;
|
|
||||||
|
|
||||||
$([document.documentElement, document.body]).animate({
|
if ($element.length) {
|
||||||
scrollTop
|
$([document.documentElement, document.body]).animate({
|
||||||
}, 400, function() {
|
scrollTop: $(query).offset().top - 200
|
||||||
$(query).wiggle(2, 100);
|
}, 400, function() {
|
||||||
});
|
$(query).wiggle(2, 100);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -179,6 +179,7 @@ export default {
|
||||||
type: 'PUT',
|
type: 'PUT',
|
||||||
data: { fields }
|
data: { fields }
|
||||||
}).catch(response => {
|
}).catch(response => {
|
||||||
|
console.log(response)
|
||||||
if (response && response.responseJSON && response.responseJSON.errors) {
|
if (response && response.responseJSON && response.responseJSON.errors) {
|
||||||
let wizardErrors = [];
|
let wizardErrors = [];
|
||||||
response.responseJSON.errors.forEach(err => {
|
response.responseJSON.errors.forEach(err => {
|
||||||
|
|
Laden …
In neuem Issue referenzieren