summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-09-06 13:57:03 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-09-06 13:57:03 -0500
commite485e601c244d45b1d23c5fa3da9332fa4cec50f (patch)
tree94dfe383f22671f334c38f691088beb96770c6d0
parent1e042ac251119c5e3b0ef8e76f3a6d9420fba98b (diff)
downloadgitlab-ce-e485e601c244d45b1d23c5fa3da9332fa4cec50f.tar.gz
Ensure we update dropdown label after selecting an option
-rw-r--r--app/assets/javascripts/gl_dropdown.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js
index 77b2082cba0..e3f672d6794 100644
--- a/app/assets/javascripts/gl_dropdown.js
+++ b/app/assets/javascripts/gl_dropdown.js
@@ -322,7 +322,13 @@
if (self.options.clicked) {
self.options.clicked(selected, $el, e);
}
- return $el.trigger('blur');
+
+ // Update label right after all modifications in dropdown has been done
+ if (self.options.toggleLabel) {
+ self.updateLabel(selected, $el, self);
+ }
+
+ $el.trigger('blur');
});
}
}
@@ -594,11 +600,6 @@
}
}
- // Update label right after input has been added
- if (this.options.toggleLabel) {
- this.updateLabel(selectedObject, el, this);
- }
-
return selectedObject;
};