Commit 0084b354 authored by Andrew Fontaine's avatar Andrew Fontaine Committed by Heinrich Lee Yu

Revert "Merge branch 'tz-defer-frequent-item-init' into 'master'"

This reverts commit e64320b1, reversing
changes made to 5e2d483e.
parent b5d4731d
......@@ -16,12 +16,15 @@ const frequentItemDropdowns = [
},
];
const initFrequentItemList = (namespace, key) => {
export default function initFrequentItemDropdowns() {
frequentItemDropdowns.forEach(dropdown => {
const { namespace, key } = dropdown;
const el = document.getElementById(`js-${namespace}-dropdown`);
const navEl = document.getElementById(`nav-${namespace}-dropdown`);
// Don't do anything if element doesn't exist (No groups dropdown)
// This is for when the user accesses GitLab without logging in
if (!el) {
if (!el || !navEl) {
return;
}
......@@ -58,21 +61,8 @@ const initFrequentItemList = (namespace, key) => {
});
})
.catch(() => {});
};
export default function initFrequentItemDropdowns() {
frequentItemDropdowns.forEach(dropdown => {
const { namespace, key } = dropdown;
const navEl = document.getElementById(`nav-${namespace}-dropdown`);
// Don't do anything if element doesn't exist (No groups dropdown)
// This is for when the user accesses GitLab without logging in
if (!navEl) {
return;
}
$(navEl).on('shown.bs.dropdown', () => {
initFrequentItemList(namespace, key);
eventHub.$emit(`${namespace}-dropdownOpen`);
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment