Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 17th, 2012  |  syntax: Diff  |  size: 1.03 KB  |  views: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. --- trunk/build/editor.js       (revision 569106)
  2. +++ trunk/build/editor.js       (working copy)
  3. @@ -660,8 +660,15 @@
  4.        $thickbox.find('#tab-type_url').remove();
  5.        return $thickbox.delegate('.media-item :submit', 'click', function(ev) {
  6.          var $item, attachment_id;
  7. -        $item = jQuery(ev.currentTarget).closest('.media-item');
  8. -        attachment_id = $item.attr('id').replace('media-item-', '');
  9. +        /*
  10. +                Alan (adrichey) - Below breaks if image was initially uploaded as it gets a temp ID
  11. +                As a result, I have replaced the two lines with something more accurate
  12. +                Need to replace in editor.min.js as well
  13. +        */
  14. +        //$item = jQuery(ev.currentTarget).closest('.media-item');
  15. +        //attachment_id = $item.attr('id').replace('media-item-', '');
  16. +        $item = jQuery(ev.currentTarget).closest('.media-item').find('.media-item-info');
  17. +        attachment_id = $item.attr('id').replace('media-head-', '');
  18.          _this.ajax_set(attachment_id);
  19.          return false;
  20.        });
clone this paste RAW Paste Data