mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 01:23:53 -07:00
more validation
This commit is contained in:
parent
e4c8255d69
commit
488da59143
14 changed files with 105 additions and 69 deletions
|
@ -2,7 +2,7 @@ define(
|
|||
[
|
||||
'backbone.validation',
|
||||
'underscore',
|
||||
'jQuery/Validation'
|
||||
'jQuery/jquery.validation'
|
||||
], function (Validation, _) {
|
||||
'use strict';
|
||||
|
||||
|
@ -27,7 +27,10 @@ define(
|
|||
var boundHandler = errorHandler.bind(this);
|
||||
|
||||
this.model.sync = function () {
|
||||
self.$el.removeBootstrapError();
|
||||
self.$el.removeAllErrors();
|
||||
|
||||
arguments[2].isValidatedCall = true;
|
||||
|
||||
return self.originalSync.apply(this, arguments).fail(boundHandler);
|
||||
};
|
||||
}
|
||||
|
@ -71,9 +74,13 @@ define(
|
|||
var validationErrors = JSON.parse(response.responseText);
|
||||
|
||||
_.each(validationErrors, function (error) {
|
||||
view.$el.addBootstrapError(error);
|
||||
view.$el.processServerError(error);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue