Variation image. Closes #795.

This commit is contained in:
Mike Jolley 2012-03-14 23:12:02 +00:00
parent c4dcac383b
commit 5955cb4e02
1 changed files with 7 additions and 5 deletions

View File

@ -590,11 +590,12 @@ function variable_product_type_options() {
window.send_to_cproduct = function(html) { window.send_to_cproduct = function(html) {
var img = jQuery(html).find('img'); jQuery('body').append('<div id="temp_image">' + html + '</div>');
imgurl = jQuery(img).attr('src'); var img = jQuery('#temp_image').find('img');
imgclass = jQuery(img).attr('class');
imgurl = img.attr('src');
imgclass = img.attr('class');
imgid = parseInt(imgclass.replace(/\D/g, ''), 10); imgid = parseInt(imgclass.replace(/\D/g, ''), 10);
jQuery('.upload_image_id', current_field_wrapper).val(imgid); jQuery('.upload_image_id', current_field_wrapper).val(imgid);
@ -602,6 +603,7 @@ function variable_product_type_options() {
jQuery('img', current_field_wrapper).attr('src', imgurl); jQuery('img', current_field_wrapper).attr('src', imgurl);
tb_remove(); tb_remove();
window.send_to_editor = window.send_to_editor_default; window.send_to_editor = window.send_to_editor_default;
} }