Not all changes were needed, but I did them anyway to get the code a bit cleaner and easier to understand.
Basic changes:
Use $prefix on all jQuery variables
Use var print_frame_ref = $print_frame.get(0).contentDocument; to get contentDocument of iframe.
Use $print_frame.height($print_frame.contents().height()); to get/set height of iframe contents
Also clone() scripts to the iframe, (I needed them for my layout)
Use
$('img').on('load', print_frame_ref, function(){
$print_frame.height($print_frame.contents().height());
})
To bind load events of images inside the iframe.
Rename distroyPrintPreview to destroyPrintPreview.
Rename resize..printPreview.mask to resize.printPreview.mask
NOTE: Uses the new on method so requires jQuery 1.7
Not all changes were needed, but I did them anyway to get the code a bit cleaner and easier to understand.
Basic changes:
NOTE: Uses the new on method so requires jQuery 1.7