[wp-trac] [WordPress Trac] #39074: No method to move meta boxes using keyboard
WordPress Trac
noreply at wordpress.org
Fri Aug 14 01:45:43 UTC 2020
#39074: No method to move meta boxes using keyboard
-------------------------------------------------+-------------------------
Reporter: joedolson | Owner: afercia
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.5
Component: Administration | Version:
Severity: normal | Resolution: fixed
Keywords: wpcampus-report has-screenshots | Focuses: ui,
has-dev-note | accessibility
-------------------------------------------------+-------------------------
Comment (by johnstonphilip):
This change broke some of my years-older projects that are still out in
the wild.
I was running some jquery to load the contents of metaboxes using ajax
when they are opened. Because there's a new container now, it required
another parent call to get to the top of the metabox.
Old code which broke because of this change:
{{{
$( document ).on( 'click', '.postbox .handlediv, .postbox .hndle',
function( event ){
var content_placeholder = $(this).parent().find(
'.my_metabox_ajax_placeholder' );
// Did ajax call to replace the placeholder here.
}
}}}
Updated code which fixed it due to the new wrapping elements added here:
{{{
$( document ).on( 'click', '.postbox .handlediv, .postbox .hndle',
function( event ){
var content_placeholder = $(this).parent().parent().parent().find(
'.my_metabox_ajax_placeholder' );
// Did ajax call to replace the placeholder here.
}
}}}
Take note of the parent().parent().parent() calls.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39074#comment:90>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list