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

navigation_utility.js « utils « lib « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1579b225e44d16ba5e28ca7f6b956e536ba2e30b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { visitUrl } from './url_utility';

/**
 * Helper function that finds the href of the fiven selector and updates the location.
 *
 * @param  {String} selector
 */
export default function findAndFollowLink(selector) {
  const element = document.querySelector(selector);
  const link = element && element.getAttribute('href');

  if (link) {
    visitUrl(link);
  }
}