[wp-trac] [WordPress Trac] #33509: customize-control.js : $.contains( document, this.container ) always returns false

WordPress Trac noreply at wordpress.org
Sat Aug 22 13:44:45 UTC 2015


#33509: customize-control.js : $.contains( document, this.container ) always
returns false
--------------------------+-----------------------------------------
 Reporter:  nikeo         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.3
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript, administration
--------------------------+-----------------------------------------

Comment (by nikeo):

 Hi, @BinaryKitten thanks for the appreciation and fiddle :)

 About the point you've been raising, I'm not sure about this though.
 According to the .get() jQuery doc ( https://api.jquery.com/get/) the use
 of .get() or the array dereferencing operator is equivalent and shall be
 driven by the need of additional capabilities that .get() can provide,
 such as specifying a negative index, which we don't specifically need in
 our case.

 >''...Each jQuery object also masquerades as an array, so we can use the
 array dereferencing operator to get at  the list item instead...''

 Another reason that makes me think the zero-based array "approach" is fine
 is that it has already been used in this file by the previous developers.
 For example here https://core.trac.wordpress.org/browser/trunk/src/wp-
 admin/js/customize-controls.js#L290.

 Would be curious to have other's point of view about this!
 Thanks :)

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


More information about the wp-trac mailing list