diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-05-06 00:47:50 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-06-04 01:14:23 +0300 |
commit | 0be26a47f20d0a536e8600a22e61ff7825983414 (patch) | |
tree | 81f8b5fdd929907b8dad8ed554683cca429705f5 /app | |
parent | 9df4da4bc08b90ff9c8a1d4ab28670e4615616d8 (diff) |
Do not trigger keyup event if we are persisting state
Triggering keyup will re-render the dropdown which is not needed when option persistWhenHide is true
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js.coffee | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee index fd51d5ee5fd..5897502ed5b 100644 --- a/app/assets/javascripts/gl_dropdown.js.coffee +++ b/app/assets/javascripts/gl_dropdown.js.coffee @@ -317,12 +317,17 @@ class GitLabDropdown hidden: (e) => @removeArrayKeyEvent() + $input = @dropdown.find(".dropdown-input-field") + if @options.filterable - @dropdown - .find(".dropdown-input-field") + $input .blur() .val("") - .trigger("keyup") + + # Triggering 'keyup' will re-render the dropdown which is not always required + # specially if we want to keep the state of the dropdown needed for bulk-assignment + if not @options.persistWhenHide + $input.trigger("keyup") if @dropdown.find(".dropdown-toggle-page").length $('.dropdown-menu', @dropdown).removeClass PAGE_TWO_CLASS |