diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
index e78d2c9..ad15088 100644
|
|
|
300 | 300 | * @param {Object} args.completeCallback |
301 | 301 | */ |
302 | 302 | onChangeActive: function( active, args ) { |
303 | | var duration, construct = this, expandedOtherPanel; |
| 303 | var duration, construct = this, expandedOtherConstructs = []; |
304 | 304 | if ( args.unchanged ) { |
305 | 305 | if ( args.completeCallback ) { |
306 | 306 | args.completeCallback(); |
… |
… |
|
310 | 310 | |
311 | 311 | duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 ); |
312 | 312 | |
| 313 | // If this is a panel/section is not currently expanded but another is expanded, do not animate. |
313 | 314 | if ( construct.extended( api.Panel ) ) { |
314 | | // If this is a panel is not currently expanded but another panel is expanded, do not animate. |
315 | 315 | api.panel.each(function ( panel ) { |
316 | 316 | if ( panel !== construct && panel.expanded() ) { |
317 | | expandedOtherPanel = panel; |
318 | | duration = 0; |
| 317 | expandedOtherConstructs.push( panel ); |
319 | 318 | } |
320 | 319 | }); |
| 320 | } |
| 321 | if ( construct.extended( api.Section ) ) { |
| 322 | api.section.each(function ( section ) { |
| 323 | if ( section !== construct && section.expanded() ) { |
| 324 | expandedOtherConstructs.push( section ); |
| 325 | } |
| 326 | }); |
| 327 | } |
321 | 328 | |
| 329 | if ( expandedOtherConstructs.length ) { |
| 330 | duration = 0; |
| 331 | } |
| 332 | |
| 333 | if ( construct.extended( api.Panel ) ) { |
322 | 334 | // Collapse any expanded sections inside of this panel first before deactivating. |
323 | 335 | if ( ! active ) { |
324 | 336 | _.each( construct.sections(), function( section ) { |
… |
… |
|
349 | 361 | } |
350 | 362 | |
351 | 363 | // Recalculate the margin-top immediately, not waiting for debounced reflow, to prevent momentary (100ms) vertical jiggle. |
352 | | if ( expandedOtherPanel ) { |
353 | | expandedOtherPanel._recalculateTopMargin(); |
354 | | } |
| 364 | _.each( expandedOtherConstructs, function( expandedOtherConstruct ) { |
| 365 | expandedOtherConstruct._recalculateTopMargin(); |
| 366 | }); |
355 | 367 | }, |
356 | 368 | |
357 | 369 | /** |