Ticket #11269: 11269.diff

File 11269.diff, 842 bytes (added by caesarsgrunt, 3 years ago)

Fixes the scrolling issue.

Line 
1Index: wp-includes/js/swfupload/handlers.dev.js
2===================================================================
3--- wp-includes/js/swfupload/handlers.dev.js    (revision 12285)
4+++ wp-includes/js/swfupload/handlers.dev.js    (working copy)
5@@ -65,8 +65,15 @@
6        // Also bind toggle to the links
7        jQuery('a.toggle', item).click(function(){
8                jQuery(this).siblings('.slidetoggle').slideToggle(350, function(){
9-                       var o = jQuery(this).offset();
10-                       window.scrollTo(0, o.top - 36);
11+                       var w = jQuery(window).height();
12+                       var t = jQuery(this).offset().top;
13+                       var h = jQuery(this).height()
14+                       var b = t + h;
15+                       
16+                       if (b > w && (h + 48) < w)
17+                               window.scrollBy(0, b - w + 12);
18+                       else if (b > w)
19+                               window.scrollTo(0, t - 36);
20                });
21                jQuery(this).siblings('.toggle').andSelf().toggle();
22                jQuery(this).siblings('a.toggle').focus();