Make WordPress Core

Changeset 27079


Ignore:
Timestamp:
02/02/2014 11:49:05 PM (10 years ago)
Author:
azaozz
Message:

Open previews of different posts in different windows/tabs. Prevent confusion when using a former preview window again if the user navigated to edit another post. If the first post is still being edited, clicking Preview there will use the current window to show the preview. Props ippetkov, fixes #20233.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/meta-boxes.php

    r27036 r27079  
    5454}
    5555?>
    56 <a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview"><?php echo $preview_button; ?></a>
     56<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a>
    5757<input type="hidden" name="wp-preview" id="wp-preview" value="" />
    5858</div>
  • trunk/src/wp-admin/js/post.js

    r27038 r27079  
    384384
    385385    postboxes.add_postbox_toggles(pagenow);
     386
     387    // Clear the window name. Otherwise if this is a former preview window where the user navigated to edit another post,
     388    // and the first post is still being edited, clicking Preview there will use this window to show the preview.
     389    window.name = '';
    386390
    387391    // Post locks: contain focus inside the dialog. If the dialog is shown, focus the first item.
Note: See TracChangeset for help on using the changeset viewer.