function restore_events() {
			if ( $( '.et-dashboard-upload-button' ).length ) {
				var upload_button = $( '.et-dashboard-upload-button' );

				et_dashboard_image_upload( upload_button );

				upload_button.siblings( '.et-dashboard-upload-field' ).on( 'input', function() {
					et_dashboard_generate_preview_image( $( this ).siblings( '.et-dashboard-upload-button' ) );
					$(this).siblings( '.et-dashboard-upload-id' ).val('');
				} );

				upload_button.siblings( '.et-dashboard-upload-field' ).each( function() {
					et_dashboard_generate_preview_image( $( this ).siblings( '.et-dashboard-upload-button' ) );
				} );
			}

			$( '.et-dashboard-color-picker' ).wpColorPicker();

			if ( $( '.et_dashboard_conditional' ).length ) {
				$( '.et_dashboard_conditional' ).each( function() {
					window.et_dashboard_check_conditional_options( $( this ), true );
				});
			}

			//restore email services selections
			var selected_provider = $( '.et_dashboard_select_provider select' ).val(),
				selected_account = 'empty';

			if ( 'empty' == selected_provider || 'custom_html' == selected_provider ) {
				$( '.et_dashboard_select_account' ).css( { 'display' : 'none' } );
			} else {
				display_actual_accounts( selected_provider, false, '' );
				selected_account = $( '.et_dashboard_select_account select' ).val();
			}

			$( '.et_dashboard_select_list' ).css( { 'display' : 'none' } );

			if ( 'empty' !== selected_account && 'add_new' !== selected_account && ! ( 'empty' == selected_provider || 'custom_html' == selected_provider ) ) {
				display_actual_lists( selected_account, selected_provider );
			}

			check_display_options( $( '.display_on_checkboxes_everything' ), true );

			//fix the removing of tinymce editors in FireFox

			tinymce.init({
				mode : 'specific_textareas',
				editor_selector : 'et_dashboard_optin_title',
				menubar : false,
				plugins: "textcolor",
				forced_root_block : "h2",
				toolbar: [
					"forecolor | bold italic | alignleft aligncenter alignright"
				]
			});

			tinymce.init({
				mode : 'specific_textareas',
				editor_selector : 'et_dashboard_optin_message',
				menubar : false,
				plugins: "textcolor",
				toolbar: [
					"forecolor | bold italic | alignleft aligncenter alignright"
				]
			});
		}
/**
		 * Restore all jQuery events after dashboard regeneration
		 */
Restore all jQuery events after dashboard regeneration
Restore all jQuery events after dashboard regeneration
function restore_events() {
			if ( $( '.et-dashboard-upload-button' ).length ) {
				var upload_button = $( '.et-dashboard-upload-button' );
				et_dashboard_image_upload( upload_button );
				upload_button.siblings( '.et-dashboard-upload-field' ).on( 'input', function() {
					et_dashboard_generate_preview_image( $( this ).siblings( '.et-dashboard-upload-button' ) );
					$(this).siblings( '.et-dashboard-upload-id' ).val('');
				} );
				upload_button.siblings( '.et-dashboard-upload-field' ).each( function() {
					et_dashboard_generate_preview_image( $( this ).siblings( '.et-dashboard-upload-button' ) );
				} );
			}
			$( '.et-dashboard-color-picker' ).wpColorPicker();
			if ( $( '.et_dashboard_conditional' ).length ) {
				$( '.et_dashboard_conditional' ).each( function() {
					window.et_dashboard_check_conditional_options( $( this ), true );
				});
			}
			var selected_provider = $( '.et_dashboard_select_provider select' ).val(),
				selected_account = 'empty';
			if ( 'empty' == selected_provider || 'custom_html' == selected_provider ) {
				$( '.et_dashboard_select_account' ).css( { 'display' : 'none' } );
			} else {
				display_actual_accounts( selected_provider, false, '' );
				selected_account = $( '.et_dashboard_select_account select' ).val();
			}
			$( '.et_dashboard_select_list' ).css( { 'display' : 'none' } );
			if ( 'empty' !== selected_account && 'add_new' !== selected_account && ! ( 'empty' == selected_provider || 'custom_html' == selected_provider ) ) {
				display_actual_lists( selected_account, selected_provider );
			}
			check_display_options( $( '.display_on_checkboxes_everything' ), true );
			tinymce.init({
				mode : 'specific_textareas',
				editor_selector : 'et_dashboard_optin_title',
				menubar : false,
				plugins: "textcolor",
				forced_root_block : "h2",
				toolbar: [
					"forecolor | bold italic | alignleft aligncenter alignright"
				]
			});
			tinymce.init({
				mode : 'specific_textareas',
				editor_selector : 'et_dashboard_optin_message',
				menubar : false,
				plugins: "textcolor",
				toolbar: [
					"forecolor | bold italic | alignleft aligncenter alignright"
				]
			});
		}
function restore_events ( ) { if ( $ ( '.et-dashboard-upload-button' ) . length ) { var upload_button = $ ( '.et-dashboard-upload-button' ) ; et_dashboard_image_upload ( upload_button ) ; upload_button . siblings ( '.et-dashboard-upload-field' ) . on ( 'input' , function ( ) { et_dashboard_generate_preview_image ( $ ( this ) . siblings ( '.et-dashboard-upload-button' ) ) ; $ ( this ) . siblings ( '.et-dashboard-upload-id' ) . val ( '' ) ; } ) ; upload_button . siblings ( '.et-dashboard-upload-field' ) . each ( function ( ) { et_dashboard_generate_preview_image ( $ ( this ) . siblings ( '.et-dashboard-upload-button' ) ) ; } ) ; } $ ( '.et-dashboard-color-picker' ) . wpColorPicker ( ) ; if ( $ ( '.et_dashboard_conditional' ) . length ) { $ ( '.et_dashboard_conditional' ) . each ( function ( ) { window . et_dashboard_check_conditional_options ( $ ( this ) , true ) ; } ) ; } var selected_provider = $ ( '.et_dashboard_select_provider select' ) . val ( ) , selected_account = 'empty' ; if ( 'empty' == selected_provider || 'custom_html' == selected_provider ) { $ ( '.et_dashboard_select_account' ) . css ( { 'display' : 'none' } ) ; } else { display_actual_accounts ( selected_provider , false , '' ) ; selected_account = $ ( '.et_dashboard_select_account select' ) . val ( ) ; } $ ( '.et_dashboard_select_list' ) . css ( { 'display' : 'none' } ) ; if ( 'empty' !== selected_account && 'add_new' !== selected_account && ! ( 'empty' == selected_provider || 'custom_html' == selected_provider ) ) { display_actual_lists ( selected_account , selected_provider ) ; } check_display_options ( $ ( '.display_on_checkboxes_everything' ) , true ) ; tinymce . init ( { mode : 'specific_textareas' , editor_selector : 'et_dashboard_optin_title' , menubar : false , plugins : "textcolor" , forced_root_block : "h2" , toolbar : [ "forecolor | bold italic | alignleft aligncenter alignright" ] } ) ; tinymce . init ( { mode : 'specific_textareas' , editor_selector : 'et_dashboard_optin_message' , menubar : false , plugins : "textcolor" , toolbar : [ "forecolor | bold italic | alignleft aligncenter alignright" ] } ) ; }
Restore all jQuery events after dashboard regeneration
Restore all jQuery events after dashboard regeneration
//restore email services selections //fix the removing of tinymce editors in FireFox