[wp-trac] [WordPress Trac] #28581: Theme browser sidebar expand/collapse only works on every other theme

WordPress Trac noreply at wordpress.org
Thu Jun 19 02:33:03 UTC 2014


#28581: Theme browser sidebar expand/collapse only works on every other theme
--------------------------+-------------------------
 Reporter:  helen         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.0
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+-------------------------
Changes (by SergeyBiryukov):

 * keywords:  needs-patch => has-patch


Comment:

 [attachment:28581.patch] fixes both the uncontrollable duplication of
 callbacks and the collapsing issue for me.

 I'm not entirely sure what `'click .preview': 'preview'` is for
 (introduced in [27499]). The Preview button on Themes screen doesn't have
 that class, and the button on Add Themes screen doesn't require that line.

 It contributes to the issue, causing `themes.view.Theme.preview` to run
 twice on the same click, which in turn results in
 `themes.view.Preview.collapse()` running twice. Everything seems to work
 as expected without it.

 `this.undelegateEvents()` prevents old callbacks from firing if you close
 the preview and reopen it. Otherwise `themes.view.Preview.collapse()`
 still runs multiple times.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28581#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list