debian-mirror-gitlab/app/assets/javascripts/shortcuts_dashboard_navigation.js

13 lines
278 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
/**
* 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;
}
};