GitLabDropdown.prototype.opened = function()

in app/assets/javascripts/gl_dropdown.js [485:531]


GitLabDropdown.prototype.opened = function(e) {
  this.resetRows();
  this.addArrowKeyEvent();

  const dropdownToggle = this.dropdown.find('.dropdown-menu-toggle');
  const hasFilterBulkUpdate = dropdownToggle.hasClass('js-filter-bulk-update');
  const shouldRefreshOnOpen = dropdownToggle.hasClass('js-gl-dropdown-refresh-on-open');
  const hasMultiSelect = dropdownToggle.hasClass('js-multiselect');

  // Makes indeterminate items effective
  if (this.fullData && (shouldRefreshOnOpen || hasFilterBulkUpdate)) {
    this.parseData(this.fullData);
  }

  // Process the data to make sure rendered data
  // matches the correct layout
  const inputValue = this.filterInput.val();
  if (this.fullData && hasMultiSelect && this.options.processData && inputValue.length === 0) {
    this.options.processData.call(
      this.options,
      inputValue,
      this.filteredFullData(),
      this.parseData.bind(this),
    );
  }

  const contentHtml = $('.dropdown-content', this.dropdown).html();
  if (this.remote && contentHtml === '') {
    this.remote.execute();
  } else {
    this.focusTextInput();
  }

  if (this.options.showMenuAbove) {
    this.positionMenuAbove();
  }

  if (this.options.opened) {
    if (this.options.preserveContext) {
      this.options.opened(e);
    } else {
      this.options.opened.call(this, e);
    }
  }

  return this.dropdown.trigger('shown.gl.dropdown');
};