gitlab-org--gitlab-foss/app/assets/javascripts/shortcuts_dashboard_navigation.js
2017-04-06 18:14:42 -04:00

12 lines
278 B
JavaScript

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