Added collapsible tabs plugin, reworked tabIndex functions, and fixed some syntax...
[mediawiki.git] / resources / mediawiki.views / mediawiki.views.diff.js
blobab1cc3b3cbf2cbf403d03def479bfc8baba9c5e1
1 /*
2  * Diff-view progressive enhancement (ported from skins/common/diff.js)
3  * 
4  * Fixes an overflow bug in old versions of Firefox
5  */
7 ( function( $, mw ) {
9 /* Initialization */
11 $( document ).ready( function() {
12         /*
13          * Workaround for overflow bug in Mozilla 1.1 and earlier, where scrolling <div>s in <td> cells collapse their
14          * height to a single line.
15          * 
16          * Known to be fixed in 1.2.1 (Gecko 20021130), but the CSS hacks I've tried with overflow-x disable the scrolling
17          * all the way until Mozilla 1.8 / FF 1.5 and break Opera as well.
18          * 
19          * So... we check for reaaaally old Gecko and hack in an alternate rule to let the wide cells spill instead of
20          * scrolling them. Not ideal as it won't work if JS is disabled, of course.
21          */
22         if ( window.navigator && window.navigator.product == 'Gecko' && window.navigator.productSub < '20021130' ) {
23                 document.styleSheets[document.styleSheets.length - 1].insertRule(
24                         'table.diff td div { overflow: visible; }',
25                         document.styleSheets[document.styleSheets.length - 1].cssRules.length
26                 );
27         }
28 } );
30 } )( jQuery, mediaWiki );