equal
deleted
inserted
replaced
|
1 import Ember from 'ember'; |
|
2 import ENV from 'app-client/config/environment'; |
|
3 import URI from 'urijs'; |
|
4 |
|
5 export function initialize(appInstance) { |
|
6 // appInstance.inject('route', 'foo', 'service:foo'); |
|
7 const player = appInstance.lookup('service:player'); |
|
8 Ember.$(ENV.APP.navigationLinksSelector).click(function(e) { |
|
9 const locHash = window.location.hash; |
|
10 const uri = URI(Ember.$(e.target).prop('href')); |
|
11 Ember.run(() => { |
|
12 // close notice or transcript "window" |
|
13 player.displayMetadata(false); |
|
14 // if we do not navigate, force the router refresh |
|
15 if(locHash === "#"+uri.fragment()) { |
|
16 appInstance.get('router').router.refresh(); |
|
17 } |
|
18 }); |
|
19 }); |
|
20 } |
|
21 |
|
22 export default { |
|
23 name: 'nav-menu', |
|
24 initialize |
|
25 }; |