| 1 |
jQuery( document ).ready( function ( $ ) { |
| 2 |
// Enable/Disable template dropdown based on display choice in widget options. |
| 3 |
$( document ).on( 'change', '.insertpage-format-select', function() { |
| 4 |
if ( $( this ).val() == 'template' ) { |
| 5 |
$( '.insertpage-template-select' ).removeAttr( 'disabled' ); |
| 6 |
if ( $( this ).is( ':focus' ) ) { |
| 7 |
$( '.insertpage-template-select' ).focus(); |
| 8 |
} |
| 9 |
} else { |
| 10 |
$( '.insertpage-template-select' ).attr( 'disabled', 'disabled' ); |
| 11 |
} |
| 12 |
}); |
| 13 |
$( document ).on( 'widget-updated', function () { |
| 14 |
$( '.insertpage-format-select' ).change(); |
| 15 |
}) |
| 16 |
$( '.insertpage-format-select' ).change(); |
| 17 |
|
| 18 |
}); |
| 19 |
|