mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Add callback to clear form errors at create wopi files [SCI-8927] (#5877)
* Add callback to clear form errors at create wopi files [SCI-8927]
This commit is contained in:
parent
7a8663779e
commit
5a531c98ae
2 changed files with 7 additions and 1 deletions
|
@ -41,6 +41,11 @@ function initCreateWopiFileModal() {
|
|||
msg = I18n.t('assets.create_wopi_file.errors.not_found');
|
||||
}
|
||||
renderFormError(undefined, element, msg);
|
||||
})
|
||||
.on('input', '#new-wopi-file-name', function() {
|
||||
if (this.value.length <= GLOBAL_CONSTANTS.FILENAME_MAX_LENGTH) {
|
||||
$(this).closest('form').clearFormErrors();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,5 +10,6 @@ const GLOBAL_CONSTANTS = {
|
|||
REPOSITORY_CHECKLIST_ITEMS_PER_COLUMN: <%= Constants::REPOSITORY_CHECKLIST_ITEMS_PER_COLUMN %>,
|
||||
REPOSITORY_STOCK_UNIT_ITEMS_PER_COLUMN: <%= Constants::REPOSITORY_STOCK_UNIT_ITEMS_PER_COLUMN %>,
|
||||
HAS_UNSAVED_DATA_CLASS_NAME: 'has-unsaved-data',
|
||||
DEFAULT_ELEMENTS_PER_PAGE: <%= Constants::DEFAULT_ELEMENTS_PER_PAGE %>
|
||||
DEFAULT_ELEMENTS_PER_PAGE: <%= Constants::DEFAULT_ELEMENTS_PER_PAGE %>,
|
||||
FILENAME_MAX_LENGTH: <%= Constants::FILENAME_MAX_LENGTH %>,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue