Hi
I tried disabling all other Plugins but that did not help. I am running a standard WordPress 4.3 with theme TwentyFourteen.
The JS exception is raised on the last line of the below. It happens only when I select an item from the screen I shared above:
(function($){
$('#wpcufpn_widgetlist').on( 'change', function(e){
//console.log( 'selected e: ' + $('option:selected', this).val() ); //Debug
//console.log( e ); //Debug
insertShortcode( $('option:selected', this).val(), $('option:selected', this).text() );
$('#wpcufpn_widgetlist').find('option:first').attr('selected', 'selected');
tb_remove();
});
function insertShortcode( widget_id, widget_title ) {
var shortcode = '[frontpage_news';
if( null != widget_id )
shortcode += ' widget="' + widget_id + '"';
if( null != widget_title )
shortcode += ' name="' + widget_title + '"';
shortcode += ']';
/** Inserts the shortcode into the active editor and reloads display **/
var ed = tinyMCE.activeEditor;
ed.execCommand('mceInsertContent', 0, shortcode);