summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/breadcrumb.js
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-10-24 19:17:03 +0000
committerTim Zallmann <tzallmann@gitlab.com>2018-10-24 19:17:03 +0000
commitdfb082434611648658ace012d45b7d6914bc70bd (patch)
tree42c08de9e6a0420544253383473438fb12b367cc /app/assets/javascripts/breadcrumb.js
parentf8f1466ad07b3dcea7c0abc54fa25865b420b4f0 (diff)
downloadgitlab-ce-dfb082434611648658ace012d45b7d6914bc70bd.tar.gz
Prettify all the things (part 7)
Diffstat (limited to 'app/assets/javascripts/breadcrumb.js')
-rw-r--r--app/assets/javascripts/breadcrumb.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/assets/javascripts/breadcrumb.js b/app/assets/javascripts/breadcrumb.js
index 1474d93dde6..a37838694ec 100644
--- a/app/assets/javascripts/breadcrumb.js
+++ b/app/assets/javascripts/breadcrumb.js
@@ -1,6 +1,6 @@
import $ from 'jquery';
-export const addTooltipToEl = (el) => {
+export const addTooltipToEl = el => {
const textEl = el.querySelector('.js-breadcrumb-item-text');
if (textEl && textEl.scrollWidth > textEl.offsetWidth) {
@@ -14,17 +14,18 @@ export default () => {
const breadcrumbs = document.querySelector('.js-breadcrumbs-list');
if (breadcrumbs) {
- const topLevelLinks = [...breadcrumbs.children].filter(el => !el.classList.contains('dropdown'))
+ const topLevelLinks = [...breadcrumbs.children]
+ .filter(el => !el.classList.contains('dropdown'))
.map(el => el.querySelector('a'))
.filter(el => el);
const $expander = $('.js-breadcrumbs-collapsed-expander');
topLevelLinks.forEach(el => addTooltipToEl(el));
- $expander.closest('.dropdown')
- .on('show.bs.dropdown hide.bs.dropdown', (e) => {
- $('.js-breadcrumbs-collapsed-expander', e.currentTarget).toggleClass('open')
- .tooltip('hide');
- });
+ $expander.closest('.dropdown').on('show.bs.dropdown hide.bs.dropdown', e => {
+ $('.js-breadcrumbs-collapsed-expander', e.currentTarget)
+ .toggleClass('open')
+ .tooltip('hide');
+ });
}
};