Skip to content

Commit

Permalink
fix: target name gets highlited in side-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jan 26, 2020
1 parent 398bb21 commit cf4b742
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions app/components/public/side-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ import { computed } from '@ember/object';
import moment from 'moment';

export default Component.extend({
Index: undefined,
async didInsertElement() {
this._super(...arguments);
let speakersCall = await this.get('event.speakersCall');
this.set('shouldShowCallforSpeakers',
speakersCall && speakersCall.announcement && (speakersCall.privacy === 'public'));
},
actions: {
changeIndex(index) {
this.set('Index', index);
}
},
isSchedulePublished: computed('event.schedulePublishedOn', function() {
return this.get('event.schedulePublishedOn') && this.get('event.schedulePublishedOn').toISOString() !== moment(0).toISOString();
})
Expand Down
8 changes: 4 additions & 4 deletions app/templates/components/public/side-menu.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{#if (and (not-eq session.currentRouteName 'public.cfs.new-session') (not-eq session.currentRouteName 'public.cfs.new-speaker') (not-eq session.currentRouteName 'public.cfs.edit-speaker') (not-eq session.currentRouteName 'public.cfs.edit-session'))}}
<div class="ui fluid vertical {{unless device.isMobile 'pointing'}} menu">
{{#if (eq session.currentRouteName 'public.index')}}
{{#scroll-to href='#info' class='item active'}}
{{#scroll-to click=(action 'changeIndex' "info") href='#info' class=(if (eq Index "info") 'active item' 'item')}}
{{t 'Info'}}
{{/scroll-to}}
{{#if event.tickets.length}}
{{#scroll-to href='#tickets' class='item'}}
{{#scroll-to click=(action 'changeIndex' "tickets") href='#tickets' class=(if (eq Index "tickets") 'active item' 'item')}}
{{t 'Tickets'}}
{{/scroll-to}}
{{/if}}
Expand Down Expand Up @@ -46,7 +46,7 @@
{{/if}}
{{#if event.hasOwnerInfo}}
{{#if (eq session.currentRouteName 'public.index')}}
{{#scroll-to href='#owner' class='item'}}
{{#scroll-to click=(action 'changeIndex' "owner") href='#owner' class=(if (eq Index "owner") 'active item' 'item')}}
{{t 'Owner'}}
{{/scroll-to}}
{{else}}
Expand All @@ -56,7 +56,7 @@
{{/if}}
{{/if}}
{{#if (eq session.currentRouteName 'public.index')}}
{{#scroll-to href='#getting-here' class='item'}}
{{#scroll-to click=(action 'changeIndex' "gettingHere") href='#getting-here' class=(if (eq Index "gettingHere") 'active item' 'item')}}
{{t 'Getting here'}}
{{/scroll-to}}
{{else}}
Expand Down

0 comments on commit cf4b742

Please sign in to comment.