Permalink
Browse files

Use some JS hackery to move the author element to the right position …

…in Quick Edit
  • Loading branch information...
1 parent 475b01d commit a5be34e16e0c756fdd00ccb858c2d08ecdf20c96 @danielbachhuber danielbachhuber committed Feb 1, 2014
Showing with 20 additions and 11 deletions.
  1. +6 −10 co-authors-plus.php
  2. +8 −0 css/co-authors-plus.css
  3. +6 −1 js/co-authors-plus.js
View
@@ -474,17 +474,13 @@ function _action_quick_edit_custom_box( $column_name, $post_type ) {
)
return;
?>
- <fieldset class="inline-edit-col-left inline-edit-coauthors">
- <div class="inline-edit-col column-coauthors">
- <label class="inline-edit-group">
- <span class="title"><?php _e( 'Authors', 'co-authors-plus' ) ?></span>
- <div id="coauthors-edit" class="hide-if-no-js">
- <p><?php _e( 'Click on an author to change them. Drag to change their order. Click on <strong>Remove</strong> to remove them.', 'co-authors-plus' ); ?></p>
- </div>
- <?php wp_nonce_field( 'coauthors-edit', 'coauthors-nonce' ); ?>
- </label>
+ <label class="inline-edit-group inline-edit-coauthors">
+ <span class="title"><?php _e( 'Authors', 'co-authors-plus' ) ?></span>
+ <div id="coauthors-edit" class="hide-if-no-js">
+ <p><?php _e( 'Click on an author to change them. Drag to change their order. Click on <strong>Remove</strong> to remove them.', 'co-authors-plus' ); ?></p>
</div>
- </fieldset>
+ <?php wp_nonce_field( 'coauthors-edit', 'coauthors-nonce' ); ?>
+ </label>
<?php
}
View
@@ -1,3 +1,11 @@
+.inline-edit-group.inline-edit-coauthors {
+ display: none;
+}
+
+.inline-edit-group.inline-edit-coauthors #coauthors-edit {
+ margin-left: 5em;
+}
+
#coauthors-list {
width: 100%;
padding: 0 5px;
View
@@ -490,7 +490,7 @@ jQuery(document).ready(function () {
}
else if ( 'edit-post' == pagenow ) {
- var wpInlineEdit = inlineEditPost.edit
+ var wpInlineEdit = inlineEditPost.edit;
inlineEditPost.edit = function( id ) {
@@ -505,6 +505,11 @@ jQuery(document).ready(function () {
var $postRow = jQuery( '#post-' + postId )
+ // Move the element to the appropriate position in the view
+ // JS hack for core bug: https://core.trac.wordpress.org/ticket/26982
+ var el = jQuery('.inline-edit-group.inline-edit-coauthors', '#edit-' + postId );
+ el.detach().appendTo('.quick-edit-row .inline-edit-col-left .inline-edit-col').show();
+
// initialize coauthors
var post_coauthors = jQuery.map(jQuery('.column-coauthors a', $postRow), function(el) {
return {

0 comments on commit a5be34e

Please sign in to comment.