etimbo / jquery-print-preview-plugin

jQuery plugin for print preview (modal window)
jquery-print-preview-plugin
382 stars 128 forks source link

Compatibility jQuery 3 #24

Open cavo789 opened 7 years ago

cavo789 commented 7 years ago

Hi all

(sorry, I don't know yet how to suggest a Pull request)

I've made a very small changes in the jquery.print-preview.js file in order to be compatible with jQuery 3.1.

Original lines:

- $('img', print_frame_ref).load(function() {
   print_frame.height($('body', print_frame.contents())[0].scrollHeight);
});

Once modified :

+ $('img', print_frame_ref).on('load', function() {
   print_frame.height($('body', print_frame.contents())[0].scrollHeight);
);

The change concern the first line : don't call anymore .load(function() {...}) but use .on('load',function() {...} );

lukescammell commented 7 years ago

Looks legitimate. http://api.jquery.com/load-event/ jQuery version deprecated: 1.8, removed: 3.0