PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
← All changes | admin/js/common.js +9 -28 2.0.4 → 3.4 View file →
@@ -6,16 +6,11 @@
6 6 * @author Tobias Bäthge
7 7 * @since 1.0.0
8 8 */
9 9
10 -/* globals confirm, postboxes, pagenow */
10 +/* globals postboxes, pagenow, jQuery */
11 11
12 12 /**
13 - * WordPress dependencies.
14 - */
15 -import { _n } from '@wordpress/i18n';
16 -
17 -/**
18 13 * Enable toggle/order functionality for post meta boxes.
19 14 * For TablePress, pagenow has the form "tablepress_{$action}".
20 15 *
21 16 * @since 1.0.0
@@ -21,26 +16,12 @@
21 16 * @since 1.0.0
22 17 */
23 18 postboxes.add_postbox_toggles( pagenow );
24 19
25 -document.getElementById( 'tablepress-page' ).addEventListener( 'click', ( event ) => {
26 - if ( ! event.target ) {
27 - return;
28 - }
29 -
30 - /**
31 - * Show an AYS warning when a "Delete" link is clicked.
32 - *
33 - * @since 1.0.0
34 - */
35 - if ( event.target.matches( '.delete-link' ) ) {
36 - if ( ! confirm( _n( 'Do you really want to delete this table?', 'Do you really want to delete these tables?', 1, 'tablepress' ) ) ) {
37 - event.preventDefault();
38 - return;
39 - }
40 -
41 - // Prevent onunload warning, by calling unset method from edit.js (if defined).
42 - window?.tp?.helpers?.unsaved_changes?.unset?.();
43 -
44 - return;
45 - }
46 -} );
20 +/**
21 + * Turn off the collapsing feature of postboxes when directly clicking on the postbox header bar.
22 + * This causes confusion to many users that accidentally click this.
23 + * After this, the postboxes can only be collapsed/expanded via the arrow icon in their header bar.
24 + *
25 + * @since 2.1.0
26 + */
27 +jQuery( '.postbox .hndle' ).off( 'click.postboxes', postboxes.handle_click );