Opened 11 years ago
Closed 11 years ago
#27198 closed enhancement (fixed)
Improve pushState/hashChange routing in Appearance > Themes
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.8.1 |
Component: | Themes | Keywords: | has-patch |
Focuses: | javascript | Cc: |
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
@
11 years ago
27198-02.patch makes sure that the overlay closes when hitting the search route if present.
#3
in reply to:
↑ 2
@
11 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
@
11 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.searching
so 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
@
11 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.searching
so that we pushSate instead of replaceState when searching again- Clearing a search should pushState instead of replaceState
Also, uses correct
keyCode
forenter
.
Looks good to me, 13 makes more sense than 15 :)
#6
@
11 years ago
27148-04.patch only enables routing if the browser supports pushState
and cleans up how the root is specified.
#7
@
11 years ago
- Owner set to markjaquith
- Resolution set to fixed
- Status changed from new to closed
In 27268:
#8
@
11 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
@
11 years ago
- Resolution fixed deleted
- Status changed from closed to 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
@
11 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.
Added 27198-01.patch based on 26543-ie8-routing-fix.diff, which I think is ready to go.