Changes between Initial Version and Version 1 of Ticket #27848, comment 5
- Timestamp:
- 04/17/2014 05:00:19 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27848, comment 5
initial v1 5 5 During `api.HeaderControl.ready()`, on [https://core.trac.wordpress.org/browser/tags/3.9/src/wp-admin/js/customize-controls.js#L322 lines 322-325 of customize-controls.js], we instantiate a new `api.HeaderTool.CurrentView`. 6 6 7 Inside of `api.HeaderTool.CurrentView` is a method called `setButtons()`, seen on [https://core.trac.wordpress.org/browser/tags/3.9/src/wp- admin/js/customize-views.js#L72 line 72 of customize-views.js]. This gets called during render, which is called when the moment the view is instantiated in `api.HeaderControl.ready()`.7 Inside of `api.HeaderTool.CurrentView` is a method called `setButtons()`, seen on [https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/js/customize-views.js#L72 line 72 of customize-views.js]. This gets called during render, which is called when the moment the view is instantiated in `api.HeaderControl.ready()`. 8 8 9 9 The sole purpose `api.HeaderTool.CurrentView.setButtons()` is to determine whether or not `.actions .remove` should be shown or hidden based on the current view. 10 10 11 The issue here is that `setButtons()` is targeting ''any'' matching elements via`$('.actions .remove')` and instead the selector should be limited to the view's scope (e.g. `this.$el.find('.actions .remove')`). I know that fixes the problem, anyway, but I'm not sure what other problems it may create.11 The issue here is that `setButtons()` is targeting ''any'' matching elements via`$('.actions .remove')` on [https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/js/customize-views.js#L73 line 73 of customize-views.js]. Instead, the selector should be limited to the view's scope (e.g. `this.$el.find('.actions .remove')`). I know that fixes ''this'' problem, anyway, but I'm not sure what other problems it may create. :) 12 12 13 13 I'm going to dig in a bit more.