On devices with <992px width (sm, xs), sidebar doesn't open when swh-push-menu is clicked first time.
This was due to webapp-utils.js:5 setting collapseSidebar to false by default on all devices.
Details
- Reviewers
vlorentz anlambert - Group Reviewers
Reviewers - Commits
- rDWAPPS208d01b1fe9d: Fix sidebar not opening first time
Diff Detail
- Repository
- rDWAPPS Web applications
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/490/ for more details.
Oh, right!
Can we/should we import the constant from bootstrap instead of hardcoding it here?
We can't import these constants from bootstrap directly.
We can declare breakpoint constants globally for all the files.
If we want to have these constants for all the end to end tests ( where they will be mostly used), I think we can add the to index.js
Something like BP_XS, BP_SM, BP_MD, BP_LG may be globally declared constants
I'd prefer them to be named BREAKPOINT_* instead of BP_*, but that sounds nice, thanks
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/491/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/492/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DWAPPS/job/tox/493/ for more details.
Just a small change to do and I will accept the diff.
swh/web/assets/src/bundles/webapp/webapp-utils.js | ||
---|---|---|
26–29 | You should move this after line 6. Indeed, we backup the state of the sidebar in the localStorage to restore it when visiting the Software Heritage archive website again. Otherwise, I am OK with this fix. |
swh/web/assets/src/bundles/webapp/webapp-utils.js | ||
---|---|---|
26–29 | But if the device is sm or xs we don't restore state from local storage. (Sidebar is always collapsed when you open any page irrespective of previous state) |
swh/web/assets/src/bundles/webapp/webapp-utils.js | ||
---|---|---|
26–29 | Indeed, you are right. So this can be landed as is. |