Widgets: Ensure title field for media widget will update with sanitized value after `change` event in addition to `input` event.

Aligns behavior of field with Text widget and other widgets whereby the server-sanitized title (via the `widget-update` request) is supplied into the field after the `change` event.

See #32417.
Fixes #40805.

Built from https://develop.svn.wordpress.org/trunk@40785


git-svn-id: http://core.svn.wordpress.org/trunk@40643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2017-05-18 21:04:41 +00:00
parent 698c6de4da
commit e62f6ac8fe
3 changed files with 3 additions and 3 deletions

View File

@ -483,7 +483,7 @@ wp.mediaWidgets = ( function( $ ) {
control.listenTo( control.model, 'change', control.render );
// Update the title.
control.$el.on( 'input', '.title', function updateTitle() {
control.$el.on( 'input change', '.title', function updateTitle() {
control.model.set({
title: $.trim( $( this ).val() )
});

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-beta1-40784';
$wp_version = '4.8-beta1-40785';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.