-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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: side menu icon should not be visible in mobile when there is no menu #3665
Conversation
app/templates/public.hbs
Outdated
</button> | ||
{{#if isMenuOpen}} | ||
{{public/side-menu class='toggle menu' event=model}} | ||
{{#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'))}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using such conditionals in the templates, please use a computed property from controllers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same condition is used in side-menu.hbs file for visibility of menu .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really brittle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspected so, @maze-runnar make a computed property and use it for the above condition too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have made the computed property and it's working fine . may i make changes here ?
@kushthedude please review |
app/controllers/public.js
Outdated
@@ -11,6 +11,11 @@ export default Controller.extend({ | |||
displayEndDate: computed('model.startsAtDate', 'model.endsAtDate', function() { | |||
return !moment(this.model.startsAtDate).isSame(this.model.endsAtDate, 'minute'); | |||
}), | |||
displaySideMenu: computed('session.currentRouteName', function() { | |||
if (this.get('session.currentRouteName')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont use ES5 getter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then what ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should i migrate it to ES6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this.get('session') this.session
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the same file :
smallLead: computed('session.currentRouteName', function() {
if (this.get('session.currentRouteName')) {
return this.get('session.currentRouteName') !== 'public.index';
}
}),
Should i change ES5 here too ?
@kushthedude should i open a seperate PR for migrating "app/controllers/public.js" to ES6. |
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- app/controllers/public.js 3
See the complete overview on Codacy |
fixes : #3656
visible for other pages
Checklist
development
branch.