Welcome to mirror list, hosted at ThFree Co, Russian Federation.

title.js « utils « repository « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 87d54c012002bc38dfc0667f7adcba5bc4ebad2e (plain)
1
2
3
4
5
6
7
8
9
10
// eslint-disable-next-line import/prefer-default-export
export const setTitle = (pathMatch, ref, project) => {
  if (!pathMatch) return;

  const path = pathMatch.replace(/^\//, '');
  const isEmpty = path === '';

  /* eslint-disable-next-line @gitlab/i18n/no-non-i18n-strings */
  document.title = `${isEmpty ? 'Files' : path} · ${ref} · ${project}`;
};