👁 查看:wp-page-widget.js
路径:/home/forge/kingkrunch.com/wp/wp-content/plugins/black-studio-tinymce-widget/js/wp-page-widget.js
大小:944 B · 修改:2026-08-21 14:42:26 · 权限:0644 · 可写
/* Black Studio TinyMCE Widget - Compatibility with WP Page Widget plugin */

/* global bstw */

(function( $ ) {

	$( document ).ready(function() {

		// Event handler for widget save button
		$( document ).on( 'click', '#pw-sidebars-customize div[id*=black-studio-tinymce].widget input.widget-control-save', function() {
			$( this ).unbind( 'ajaxSuccess' ).ajaxSuccess(function( ) {
				$( this ).trigger( 'widget-updated', [ bstw( $( this ) ).get_widget() ] ).unbind( 'ajaxSuccess' );
			});
		});

		// Event handler for widget open button
		$( document ).on( 'click', '#pw-sidebars-customize div[id*=black-studio-tinymce].widget .widget-title', function() {
			var $textarea = bstw( $( this ) ).get_textarea();
			if ( $textarea.hasClass( 'active' ) ) {
				bstw( $( this ) ).deactivate();
				$( this ).trigger( 'widget-added', [ bstw( $( this ) ).get_widget() ] );
			}
		});

	});
		
})( jQuery ); // end self-invoked wrapper function