Skip to content

Commit

Permalink
Make Customizer preview refresh when insert CT Section widget video
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Gliebe committed Oct 27, 2016
1 parent fd4c070 commit 4d31fcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/admin-widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jQuery( document ).ready( function( $ ) {
} );

/**************************************
* MEDIA UPLOADER
* VIDEO FIELD
**************************************/

// Open media uploader on button click
Expand Down Expand Up @@ -160,8 +160,12 @@ jQuery( document ).ready( function( $ ) {
if ( typeof attachment != 'undefined' ) {

// Set attachment URL on input
// Also trigger change event to make Customizer refresh preview
if ( attachment.url ) {
$input_element.val( attachment.url ); // input is directly before button

$input_element
.val( attachment.url ) // input is directly before button
.change();
}

}
Expand Down

0 comments on commit 4d31fcd

Please sign in to comment.