[wp-trac] [WordPress Trac] #20337: On theme customizer, back button should close preview mode

WordPress Trac wp-trac at lists.automattic.com
Mon Apr 9 15:04:31 UTC 2012


#20337: On theme customizer, back button should close preview mode
----------------------------+--------------------------
 Reporter:  jane            |       Owner:  koopersmith
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  3.4
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+--------------------------

Comment (by SergeyBiryukov):

 Not sure how to use `windows.history` in this context, since it doesn't
 allow changes to history.

 [attachment:20337.2.patch] is another attempt. After clicking browser's
 Back button, Forward button works as well (returns to Theme Customizer).

 Tested in Firefox 11, Chrome 18, IE 8, Opera 11.62, Safari 5.1.5.

 The patch uses `onhashchange` rather than `onpopstate`, since the latter
 is not supported by IE 8.

 The `if ( Loader.iframe )` check in line 68 is due to `Loader.close()`
 being called twice when clicking `.close-full-overlay`:
 1. Directly in `this.element.click`.
 2. Via `window.onhashchange`.
 It would probably be a bit cleaner to remove the call from
 `this.element.click` and let `onhashchange` handle the closing.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20337#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list