diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-04-13 18:45:26 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-04-13 18:45:26 +0300 |
commit | 203185feca9d1ba8063d817d18b535c673794ef2 (patch) | |
tree | 2578d04bf26bee23cd2e881cb1d95efa9ab1b14e /app/assets/javascripts/shortcuts_dashboard_navigation.js | |
parent | 7ec607d4413b05461771e66b69ba8e332524bf55 (diff) |
add test for shortcuts_dashboard_navigation.js
Diffstat (limited to 'app/assets/javascripts/shortcuts_dashboard_navigation.js')
-rw-r--r-- | app/assets/javascripts/shortcuts_dashboard_navigation.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/shortcuts_dashboard_navigation.js b/app/assets/javascripts/shortcuts_dashboard_navigation.js index 8d1cd0ea658..9f69f110d06 100644 --- a/app/assets/javascripts/shortcuts_dashboard_navigation.js +++ b/app/assets/javascripts/shortcuts_dashboard_navigation.js @@ -1,13 +1,15 @@ +import { visitUrl } from './lib/utils/url_utility'; + /** * Helper function that finds the href of the fiven selector and updates the location. * * @param {String} selector */ -export default selector => { +export default function findAndFollowLink(selector) { const element = document.querySelector(selector); const link = element && element.getAttribute('href'); if (link) { - window.location = link; + visitUrl(link); } -}; +} |