-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Mobile settings do not open on the correct page #3138
Comments
Is this one of the screens that, on clientold, worked via flipping back and forth between the menu and the screen itself, ala the content menu's functionality? |
@novaugust I think so? My thinking is (pending @JohnONolan's approval) is that on desktop, the settings should open on the general tab, but on mobile/tablet it should open on the settings menu. |
I'm thinking this has a very similar solution to this bit of code on the posts view |
Thanks for the tip, @novaugust ! Just had a play around with this. In my first (super-hacky) attempt, I'm getting the last item of the URL and finding it's link, then pseudo-clicking it. // Starting on #L28 of /core/client/views/settings.js
responsiveAction(event, '(max-width: 800px)', function () {
var pathname_array = window.location.pathname.split("/"),
clean_pathname_array = $.grep(pathname_array,function(n){ return(n) }),
last_pathname_item = clean_pathname_array.slice(-1).pop();
$(".settings-menu a[href$='"+ last_pathname_item +"/']").parent("li").click();
}); However, I know this isn't the best solution at all – you can see the transition happen. |
Hooo boy. Remember when I said "Yeah, I don't think this will be too tricky"? I may have lied. I didn't think about the transitioning around -- all that crossed my mind was, the functionality (spin one screen around to the other) would be the same. I sent you off on a dark path man. Let me get back to you on this when I get home and can play with what the original issue actually was, rather than how I pictured it in my mind. |
Okay, I'm caught up with the issue and get what's going on here. You're right - what this ultimately needs is a bit of refactoring to work beautifully on mobile. With the current implementation, there's no way to go to Really, what's getting us here is we're having jQuery do ember's job, because we already had jQuery implementations on clientOld and the easiest thing to do was bring that code straight over. Yeah, the only thing I can come up with off the top of my head is, create a view for each settings sub page and have it bind some css properties on init based on the viewport size. ^^ I feel like that sentence may be un-understandable to anyone who wasn't in my head as it was produced. Sorry about that, IRC me so I don't get outrageously lengthy on this comment |
@PaulAdamDavis I spent somewhere around a-silly-amount-of-time playing with this today. I got it to show the menu when at Do you think it would be possible to remove the jQuery |
Closes TryGhost#3254, closes TryGhost#3138, closes TryGhost#3245 ### Settings Routing and View refactoring - Refactored `SettingsView` to handle transitions between mobile and desktop layouts - `SettingsRoute` will only transition to `settings.general` if the screen is large enough to show both the menu and the content - Added `SettingsIndexView` to handle showing the settings menu on mobile screens - Added `SettingsContentBaseView` to be inherited by any settings view that is not index. - Updated Settings templates appropriately to work with new views - Removed extraneous `active` class from `settings-content` - Changed settings menu to use `gh-activating-list-item` - Retooled settings tests ### Mobile Utils - Renamed file to `mobile.js`, since it's inside of `utils/` - Added `mobileQuery` MediaQueryList to help detect layout changes - Removed unused `hasTouchScreen`, `device.js` should be used instead. - Removed unused `smallScreen` function - Moved FastClickInit to codemirror-mobile
Issue Summary
When you go to the settings pages (
/ghost/ember/settings/
) on mobile, no matter what the URL is, the page shown is the settings menu.In other words, going to
/ghost/ember/settings/general/
shows the settings menu.So the page shown in the Settings section should match what is in the URL.
Steps to Reproduce
/ghost/ember/settings/general/
in a browser less that 800px wideExpected Results
You see the general settings page
Actual Results
You see the Settings menu.
Technical details:
The text was updated successfully, but these errors were encountered: