[wp-trac] [WordPress Trac] #44264: Give progress indication for export and erasure
WordPress Trac
noreply at wordpress.org
Fri Feb 14 23:28:52 UTC 2020
#44264: Give progress indication for export and erasure
---------------------------------------+------------------------------
Reporter: allendav | Owner: garrett-eclipse
Type: enhancement | Status: reopened
Priority: normal | Milestone: 5.4
Component: Privacy | Version: 4.9.6
Severity: normal | Resolution:
Keywords: has-patch has-screenshots | Focuses: ui, javascript
---------------------------------------+------------------------------
Comment (by pbiron):
[https://core.trac.wordpress.org/attachment/ticket/44264/44264.7.diff
44264.7.diff] keeps the row-action progress indicator visible while the
export/erase is happening.
In keeping with the lack of JS Docs for the rest of the file, I didn't
bother adding any for the 2 functions added by this patch :-) As
mentioned in #comment:19, we can add those later.
But I'll explain **how** it works here:
1. in all list tables, row actions are wrapped in a `div.row-actions`
2. if `div.row-actions` also has the `visible` class, then there is CSS
(in `wp-admin/css/list-tables.css`) that makes the row-actions visible
even when they aren't hovered over
3. so, at the beginning of the export/erase click handlers, the patch
simply adds the `visible` class
4. there is existing JS in
[https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/admin/common.js#L885
wp-admin/js/common.js] that makes row-actions visible/hidden when tabbing
through the table. That JS only "does it's thing" for cells with the
`has-row-actions` class
5. so, at the beginning of the export/erase click handlers, the patch also
removes the `has-row-actions` class everywhere it appears in the list
table
6. in the success/failure AJAX handlers, the patch removes the `visible`
class from `div.row-actions` and adds the `has-row-actions` class back
everywhere it was removed from
One consequence of step 5, is that if you tab through the table while the
export/erase is happening, row-actions in other rows don't become visible.
I think that's acceptable. Does anyone disagree?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44264#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list