diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /app/assets/javascripts/issuable/issuable_form.js | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/issuable/issuable_form.js')
-rw-r--r-- | app/assets/javascripts/issuable/issuable_form.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/app/assets/javascripts/issuable/issuable_form.js b/app/assets/javascripts/issuable/issuable_form.js index e8ba99e0e9e..99a3f76ca76 100644 --- a/app/assets/javascripts/issuable/issuable_form.js +++ b/app/assets/javascripts/issuable/issuable_form.js @@ -47,13 +47,12 @@ function getFallbackKey() { } export default class IssuableForm { - static addAutosave(map, id, $input, searchTerm, fallbackKey) { - if ($input.length) { - map.set( - id, - new Autosave($input, [document.location.pathname, searchTerm, id], `${fallbackKey}=${id}`), - ); - } + static addAutosave(map, id, element, searchTerm, fallbackKey) { + if (!element) return; + map.set( + id, + new Autosave(element, [document.location.pathname, searchTerm, id], `${fallbackKey}=${id}`), + ); } constructor(form) { @@ -122,28 +121,28 @@ export default class IssuableForm { IssuableForm.addAutosave( autosaveMap, 'title', - this.form.find('input[name*="[title]"]'), + this.form.find('input[name*="[title]"]').get(0), this.searchTerm, this.fallbackKey, ); IssuableForm.addAutosave( autosaveMap, 'description', - this.form.find('textarea[name*="[description]"]'), + this.form.find('textarea[name*="[description]"]').get(0), this.searchTerm, this.fallbackKey, ); IssuableForm.addAutosave( autosaveMap, 'confidential', - this.form.find('input:checkbox[name*="[confidential]"]'), + this.form.find('input:checkbox[name*="[confidential]"]').get(0), this.searchTerm, this.fallbackKey, ); IssuableForm.addAutosave( autosaveMap, 'due_date', - this.form.find('input[name*="[due_date]"]'), + this.form.find('input[name*="[due_date]"]').get(0), this.searchTerm, this.fallbackKey, ); |