Widgets: Add missing `open` class for expanded widgets in Customizer; utilize `open` class for expansion detection in Text and Media widgets.
Fixes #41625. Built from https://develop.svn.wordpress.org/trunk@41249 git-svn-id: http://core.svn.wordpress.org/trunk@41089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5c755f652b
commit
18613c0010
|
@ -1400,6 +1400,7 @@
|
|||
complete = function() {
|
||||
self.container.removeClass( 'expanding' );
|
||||
self.container.addClass( 'expanded' );
|
||||
$widget.addClass( 'open' );
|
||||
$toggleBtn.attr( 'aria-expanded', 'true' );
|
||||
self.container.trigger( 'expanded' );
|
||||
};
|
||||
|
@ -1433,6 +1434,7 @@
|
|||
complete = function() {
|
||||
self.container.removeClass( 'collapsing' );
|
||||
self.container.removeClass( 'expanded' );
|
||||
$widget.removeClass( 'open' );
|
||||
$toggleBtn.attr( 'aria-expanded', 'false' );
|
||||
self.container.trigger( 'collapsed' );
|
||||
};
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1030,7 +1030,7 @@ wp.mediaWidgets = ( function( $ ) {
|
|||
* @returns {void}
|
||||
*/
|
||||
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
|
||||
var fieldContainer, syncContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, widgetInside, animatedCheckDelay = 50, renderWhenAnimationDone;
|
||||
var fieldContainer, syncContainer, widgetForm, idBase, ControlConstructor, ModelConstructor, modelAttributes, widgetControl, widgetModel, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone;
|
||||
widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
|
||||
idBase = widgetForm.find( '> .id_base' ).val();
|
||||
widgetId = widgetForm.find( '> .widget-id' ).val();
|
||||
|
@ -1088,9 +1088,8 @@ wp.mediaWidgets = ( function( $ ) {
|
|||
* This ensures that the container's dimensions are fixed so that ME.js
|
||||
* can initialize with the proper dimensions.
|
||||
*/
|
||||
widgetInside = widgetContainer.parent();
|
||||
renderWhenAnimationDone = function() {
|
||||
if ( widgetInside.is( ':animated' ) ) {
|
||||
if ( ! widgetContainer.hasClass( 'open' ) ) {
|
||||
setTimeout( renderWhenAnimationDone, animatedCheckDelay );
|
||||
} else {
|
||||
widgetControl.render();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -354,7 +354,7 @@ wp.textWidgets = ( function( $ ) {
|
|||
* @returns {void}
|
||||
*/
|
||||
component.handleWidgetAdded = function handleWidgetAdded( event, widgetContainer ) {
|
||||
var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, widgetInside, renderWhenAnimationDone, fieldContainer, syncContainer;
|
||||
var widgetForm, idBase, widgetControl, widgetId, animatedCheckDelay = 50, renderWhenAnimationDone, fieldContainer, syncContainer;
|
||||
widgetForm = widgetContainer.find( '> .widget-inside > .form, > .widget-inside > form' ); // Note: '.form' appears in the customizer, whereas 'form' on the widgets admin screen.
|
||||
|
||||
idBase = widgetForm.find( '> .id_base' ).val();
|
||||
|
@ -401,9 +401,8 @@ wp.textWidgets = ( function( $ ) {
|
|||
* This ensures that the textarea is visible and an iframe can be embedded
|
||||
* with TinyMCE being able to set contenteditable on it.
|
||||
*/
|
||||
widgetInside = widgetContainer.parent();
|
||||
renderWhenAnimationDone = function() {
|
||||
if ( widgetInside.is( ':animated' ) ) {
|
||||
if ( ! widgetContainer.hasClass( 'open' ) ) {
|
||||
setTimeout( renderWhenAnimationDone, animatedCheckDelay );
|
||||
} else {
|
||||
widgetControl.initializeEditor();
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-alpha-41248';
|
||||
$wp_version = '4.9-alpha-41249';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue