Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50: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() {
|
||||
Ember.run.scheduleOnce('afterRender', () => {
|
||||
let query = '.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;
|
||||
let $element = $('.invalid input[type=text], .invalid textarea, .invalid input[type=checkbox], .invalid .select-kit');
|
||||
|
||||
$([document.documentElement, document.body]).animate({
|
||||
scrollTop
|
||||
}, 400, function() {
|
||||
$(query).wiggle(2, 100);
|
||||
});
|
||||
if ($element.length) {
|
||||
$([document.documentElement, document.body]).animate({
|
||||
scrollTop: $(query).offset().top - 200
|
||||
}, 400, function() {
|
||||
$(query).wiggle(2, 100);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -179,6 +179,7 @@ export default {
|
|||
type: 'PUT',
|
||||
data: { fields }
|
||||
}).catch(response => {
|
||||
console.log(response)
|
||||
if (response && response.responseJSON && response.responseJSON.errors) {
|
||||
let wizardErrors = [];
|
||||
response.responseJSON.errors.forEach(err => {
|
||||
|
|
Laden …
In neuem Issue referenzieren