Opened 12 years ago
Closed 12 years ago
#27198 closed enhancement (fixed)
Improve pushState/hashChange routing in Appearance > Themes
| Reported by: | gcorne | Owned by: | markjaquith |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | Themes | Version: | 3.8.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | javascript |
Description
Since the Backbone.History in Backbone version 1.1.1 and above includes better support for query strings, we can improve the routing UX of Appearance > Themes.
- Use pushState throughout the Appearance > Themes.
- Only use replaceState when adding characters to the search term.
- Support browsers that don't support pushState()
Attachments (6)
Change History (18)
#2
follow-up:
↓ 3
@
12 years ago
27198-02.patch makes sure that the overlay closes when hitting the search route if present.
#3
in reply to: ↑ 2
@
12 years ago
Replying to gcorne:
27198-02.patch makes sure that the overlay closes when hitting the search route if present.
Thank you.
I tested and this works great! Its awesome to see real query string routes and History intact.
I uploaded a patch (27198.diff) that includes a little minute whitespace additions.
What does this part do? event.which !== 15
#4
follow-up:
↓ 5
@
12 years ago
27198-03.patch addresses the following feedback from markjaquith:
- Searching and then clicking the back button, and then searching again should reset
this.searchingso that we pushSate instead of replaceState when searching again - Clearing a search should pushState instead of replaceState
Also, uses correct keyCode for enter.
#5
in reply to: ↑ 4
@
12 years ago
Replying to gcorne:
27198-03.patch addresses the following feedback from markjaquith:
- Searching and then clicking the back button, and then searching again should reset
this.searchingso that we pushSate instead of replaceState when searching again- Clearing a search should pushState instead of replaceState
Also, uses correct
keyCodeforenter.
Looks good to me, 13 makes more sense than 15 :)
#6
@
12 years ago
27148-04.patch only enables routing if the browser supports pushState and cleans up how the root is specified.
#8
@
12 years ago
Looks good. Side note for future reference: these changes also add ?s= routes which were missing before with the server side url parsing. Quite good timing we had with Backbone 1.1.1. :)
#9
follow-up:
↓ 10
@
12 years ago
- Resolution fixed
- Status closed → reopened
The overlay doesn't close when clicking back through history, breaks scrolling. To reproduce:
- Have enough themes available to get a scrollbar
- Go to Appearance - Themes, select any theme to show the details modal
- Hit the browser back button and try to scroll
#10
in reply to: ↑ 9
@
12 years ago
Replying to kovshenin:
The overlay doesn't close when clicking back through history, breaks scrolling.
Thanks for catching/reporting. 27198-05.patch fixes the issue.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Added 27198-01.patch based on 26543-ie8-routing-fix.diff, which I think is ready to go.