--- trunk/build/editor.js (revision 569106)
+++ trunk/build/editor.js (working copy)
@@ -660,8 +660,15 @@
$thickbox.find('#tab-type_url').remove();
return $thickbox.delegate('.media-item :submit', 'click', function(ev) {
var $item, attachment_id;
- $item = jQuery(ev.currentTarget).closest('.media-item');
- attachment_id = $item.attr('id').replace('media-item-', '');
+ /*
+ Alan (adrichey) - Below breaks if image was initially uploaded as it gets a temp ID
+ As a result, I have replaced the two lines with something more accurate
+ Need to replace in editor.min.js as well
+ */
+ //$item = jQuery(ev.currentTarget).closest('.media-item');
+ //attachment_id = $item.attr('id').replace('media-item-', '');
+ $item = jQuery(ev.currentTarget).closest('.media-item').find('.media-item-info');
+ attachment_id = $item.attr('id').replace('media-head-', '');
_this.ajax_set(attachment_id);
return false;
});