Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX #2544: Target name gets highlighted #3562

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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({
selectedIndex: undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make it index?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do this but having

actions: {
    changeIndex(index) {
      this.set('Index', index);
    }
  }

will be very confusing for future issues, if any.

async didInsertElement() {
this._super(...arguments);
let speakersCall = await this.get('event.speakersCall');
this.set('shouldShowCallforSpeakers',
speakersCall && speakersCall.announcement && (speakersCall.privacy === 'public'));
},
actions: {
changeSelectedIndex(index) {
this.set('selectedIndex', index);
}
},
isSchedulePublished: computed('event.schedulePublishedOn', function() {
return this.get('event.schedulePublishedOn') && this.get('event.schedulePublishedOn').toISOString() !== moment(0).toISOString();
})
Expand Down
20 changes: 10 additions & 10 deletions app/templates/components/public/side-menu.hbs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{#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 'changeSelectedIndex' "info") href='#info' class=(if (eq selectedIndex "info") 'active item' 'item')}}
{{t 'Info'}}
{{/scroll-to}}
{{#if event.tickets.length}}
{{#scroll-to href='#tickets' class='item'}}
{{#scroll-to click=(action 'changeSelectedIndex' "tickets") href='#tickets' class=(if (eq selectedIndex "tickets") 'active item' 'item')}}
{{t 'Tickets'}}
{{/scroll-to}}
{{/if}}
{{#if event.speakers.length}}
{{#link-to 'public.speakers' class='item'}}
{{#link-to 'public.speakers' click=(action 'changeSelectedIndex' "speakers") class=(if (eq selectedIndex "speakers") 'active item' 'item')}}
{{t 'Speakers'}}
{{/link-to}}
{{/if}}
Expand All @@ -24,29 +24,29 @@
</a>
{{/if}}
{{#if event.speakers.length}}
{{#link-to 'public.speakers' class='item'}}
{{#link-to 'public.speakers' click=(action 'changeSelectedIndex' "speakers") class=(if (eq selectedIndex "speakers") 'active item' 'item')}}
{{t 'Speakers'}}
{{/link-to}}
{{/if}}
{{/if}}
{{#if event.sessions.length}}
{{#link-to 'public.sessions' class='item'}}
{{#link-to 'public.sessions' click=(action 'changeSelectedIndex' "sessions") class=(if (eq selectedIndex "sessions") 'active item' 'item')}}
{{t 'Sessions'}}
{{/link-to}}
{{/if}}
{{#if isSchedulePublished}}
{{#link-to 'public.schedule' class='item'}}
{{#link-to 'public.schedule' click=(action 'changeSelectedIndex' "schedule") class=(if (eq selectedIndex "schedule") 'active item' 'item')}}
{{t 'Schedule'}}
{{/link-to}}
{{/if}}
{{#if shouldShowCallforSpeakers }}
{{#link-to 'public.cfs' class='item'}}
{{#link-to 'public.cfs' click=(action 'changeSelectedIndex' "callForSpeakers") class=(if (eq selectedIndex "callForSpeakers") 'active item' 'item')}}
{{t 'Call for Speakers'}}
{{/link-to}}
{{/if}}
{{#if event.hasOwnerInfo}}
{{#if (eq session.currentRouteName 'public.index')}}
{{#scroll-to href='#owner' class='item'}}
{{#scroll-to click=(action 'changeSelectedIndex' "owner") href='#owner' class=(if (eq selectedIndex "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 'changeSelectedIndex' "gettingHere") href='#getting-here' class=(if (eq selectedIndex "gettingHere") 'active item' 'item')}}
{{t 'Getting here'}}
{{/scroll-to}}
{{else}}
Expand All @@ -65,7 +65,7 @@
</a>
{{/if}}
{{#if event.codeOfConduct}}
{{#link-to 'public.coc' class='item'}}
{{#link-to 'public.coc' click=(action 'changeSelectedIndex' "coc") class=(if (eq selectedIndex "coc") 'active item' 'item')}}
{{t 'Code of Conduct'}}
{{/link-to}}
{{/if}}
Expand Down