[wp-trac] [WordPress Trac] #33509: customize-control.js : $.contains( document, this.container ) always returns false
WordPress Trac
noreply at wordpress.org
Sat Aug 22 09:54:57 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 | Keywords:
Focuses: javascript, administration |
----------------------------------------+-----------------------------
= Problem =
In the method control.onChangeActive(), the first conditional statement is
always true :
{{{
if ( ! $.contains( document, this.container ) ) {
}}}
because method $.contains( document, this.container ) is always false :).
'''The two other statements are never parsed.'''
{{{
onChangeActive: function ( active, args ) {
if ( ! $.contains( document, this.container ) ) {
// jQuery.fn.slideUp is not hiding an
element if it is not in the DOM
this.container.toggle( active );
if ( args.completeCallback ) {
args.completeCallback();
}
} else if ( active ) {
this.container.slideDown( args.duration,
args.completeCallback );
} else {
this.container.slideUp( args.duration,
args.completeCallback );
}
},
}}}
= Cause =
=> the arguments of $.contains() must be a DOM element while
this.container is a jQuery Object.
see the jQuery method doc : https://api.jquery.com/jQuery.contains/
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33509>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list