[wp-trac] [WordPress Trac] #34350: Update Backbone to 1.2.3 and Underscore to 1.8.3
WordPress Trac
noreply at wordpress.org
Fri Jan 15 04:02:02 UTC 2016
#34350: Update Backbone to 1.2.3 and Underscore to 1.8.3
-------------------------------------+------------------------------
Reporter: caseypatrickdriscoll | Owner: adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.5
Component: External Libraries | Version: 4.4
Severity: normal | Resolution:
Keywords: needs-testing has-patch | Focuses: javascript
-------------------------------------+------------------------------
Comment (by ericlewis):
In [changeset:"36305"]:
{{{
#!CommitTicketReference repository="" revision="36305"
In wp.Backbone.Subviews, extract subviews with proper Underscore.js
functions.
Subviews are stored internally on the Subview manager as an object. The
object
is composed of key-value pairs where the key is a jQuery selector for a
view,
and the value is an array of views that matching the selector.
To extract subviews, `_.flatten()` was used to collate the nested arrays
of
views into a single view. However, `_.flatten()` is not intended to be
used
for objects, and this unintended functionality breaks in newer versions of
Underscore.js.
Instead, we'll use `_.values()` to extract the arrays of views first,
and then flatten the array of arrays.
Props adamsilverstein.
See #34350.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34350#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list