Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-05-23 01:12:41 +0300
committerClement Ho <ClemMakesApps@gmail.com>2018-05-23 01:12:55 +0300
commit601c485cbc7d3d5bd37028d93a42e1e662d3709f (patch)
treeaf9930020a390f49d62600646abfc294bc575511 /app/assets/javascripts/ci_variable_list
parentd77bfe5fd9a9b56a2101a7f4e0a15f9a8f162cee (diff)
Auto close cloned dropdowns for ci variable list
The flow around Bootstrap v4 dropdown and glDropdown changed which resulted in new variable rows to having a blank dropdown open, - With BS3: opened dropdown -> clone and insert new row -> hide old dropdown -> hide new dropdown - With BS4: opened dropdown -> clone and insert new row -> hide old dropdown We are fixing this by cleaning up the dirty row clone class so we don't have to rely on magic events hiding both the old and new dropdowns
Diffstat (limited to 'app/assets/javascripts/ci_variable_list')
-rw-r--r--app/assets/javascripts/ci_variable_list/ci_variable_list.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/assets/javascripts/ci_variable_list/ci_variable_list.js b/app/assets/javascripts/ci_variable_list/ci_variable_list.js
index e177a3bfdc7..e3391cbca64 100644
--- a/app/assets/javascripts/ci_variable_list/ci_variable_list.js
+++ b/app/assets/javascripts/ci_variable_list/ci_variable_list.js
@@ -141,6 +141,11 @@ export default class VariableList {
$rowClone.find(entry.selector).val(entry.default);
});
+ // Close any dropdowns
+ $rowClone.find('.show').each((index, $dropdown) => {
+ $dropdown.classList.remove('show');
+ });
+
this.initRow($rowClone);
$row.after($rowClone);