Edit-Flow icon indicating copy to clipboard operation
Edit-Flow copied to clipboard

jQuery - redundant code for selector `#posts-filter input[type="submit"`

Open htdat opened this issue 4 years ago • 0 comments

From https://github.com/Automattic/Edit-Flow/pull/649/files


Description

Currently, this selector is used in 3 jQuery files but none of them seems relevant:

		$('#posts-filter input[type="submit"]').on( 'mousedown', function(e){
			t.revert();
		});

We will need to review and clean up this.

Details

File 1. custom-status-configure.js

From https://github.com/Automattic/Edit-Flow/pull/649/files#r644641007

On this page http://valet-vipgo-3279.test/wp-admin/admin.php?page=ef-editorial-metadata-settings, there is no exact $('#posts-filter input[type="submit"]') element though there is an element with #posts-filter. This seems redundant and I can not find how this event is triggered.

Agree - probably leftover code. (From @mikeyarce)

File 2. user-groups-configure.js

From https://github.com/Automattic/Edit-Flow/pull/649/files#r644571646

This seems redundant as there is no element with this ID posts-filter in this page http://valet-vipgo-3279.test/wp-admin/admin.php?page=ef-user-groups-settings

Then this event is not triggered.

Yeah this seems redundant. It looks like other pages like wp-admin/admin.php?page=ef-editorial-metadata-settings use this but not User Groups (From @mikeyarce)

File 3. editorial-metadata-configure.js

From https://github.com/Automattic/Edit-Flow/pull/649/files#r644641007

On this page http://valet-vipgo-3279.test/wp-admin/admin.php?page=ef-editorial-metadata-settings, there is no exact $('#posts-filter input[type="submit"]') element though there is an element with #posts-filter.

This seems redundant and I can not find how this event is triggered.

The #posts-filter element is defined here:

http://github.com/Automattic/Edit-Flow/blob/8a52203127b483576410558f940097e583d6ef3d/modules/editorial-metadata/editorial-metadata.php#L1398-L1398

htdat avatar Jun 09 '21 07:06 htdat