[wp-trac] [WordPress Trac] #23262: Update Backbone.js to 0.9.10
WordPress Trac
noreply at wordpress.org
Wed Feb 6 20:16:33 UTC 2013
#23262: Update Backbone.js to 0.9.10
--------------------------------+-----------------------
Reporter: markjaquith | Owner: nacin
Type: task (blessed) | Status: reopened
Priority: normal | Milestone: 3.6
Component: External Libraries | Version: 3.5
Severity: blocker | Resolution:
Keywords: |
--------------------------------+-----------------------
Comment (by redsweater):
I looked into this briefly. The firing of the change event as alluded to
by azaozz above does indeed cause the this._updateMenu callback to be
reached earlier than it was previously.
I don't know enough about the code, or about Backbone to make very
informed choices about reorganizing this, but I did notice for example if
I move the line:
{{{
this.on( 'change:menu', this._updateMenu, this );
}}}
Out of the media controller's constructor, and into _ready():
{{{
_ready: function() {
this._updateMenu();
this.on( 'change:menu', this._updateMenu, this );
},
}}}
Then at least the UI is allowed to complete instantiation without
exceptions, and the media window appears. Of course, as predicted, there
are further issues within once you try to navigate around the media
window.
Seems like more than one nuanced bad behavior may boil down to assumptions
in different controllers that change events will come after the add
events. In this particular case, doesn't it make sense to at least push
off the registration of the this._updateMenu callback until after the menu
has been initialized in _ready()?
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23262#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list