r83674 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83673‎ | r83674 | r83675 >
Date:21:46, 10 March 2011
Author:foxtrott
Status:deferred
Tags:
Comment:
more workarounds for browser quirks (chrome, ff, ie)
Modified paths:
  • /trunk/extensions/SemanticForms/libs/SF_popupform.js (modified) (history)
  • /trunk/extensions/SemanticForms/skins/SF_popupform.css (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/skins/SF_popupform.css
@@ -51,6 +51,7 @@
5252 border: none;
5353 background: transparent;
5454 position: relative;
 55+ overflow: hidden;
5556 }
5657
5758 div.popupform-close {
Index: trunk/extensions/SemanticForms/libs/SF_popupform.js
@@ -135,7 +135,7 @@
136136 ( navigator.userAgent.indexOf("Chrome") >= 0 &&
137137 navigator.platform.indexOf("Linux x86_64") >= 0 );
138138
139 - brokenBrowser= jQuery.browser.msie ||brokenChrome;
 139+ brokenBrowser= jQuery.browser.msie || brokenChrome;
140140
141141 var maxZIndex = 0;
142142
@@ -600,9 +600,11 @@
601601 }
602602
603603 if ( frameW != oldFrameW || frameH != oldFrameH ) {
 604+
 605+ iframe[0].style.overflow="hidden";
 606+ html[0].style.overflow="hidden";
 607+
604608 if ( animate ) {
605 - iframe[0].style.overflow="hidden";
606 - html[0].style.overflow="hidden";
607609
608610 content
609611 .width ( 'auto' )
@@ -611,14 +613,20 @@
612614 container.animate({
613615 width: frameW,
614616 height: frameH,
615 - top: ( - frameH ) / 2,
616 - left: ( - frameW ) / 2
 617+ top: Math.floor(( - frameH ) / 2),
 618+ left: Math.floor(( - frameW ) / 2)
617619 }, {
618620 duration: 500,
619621 complete: function() {
620 - iframe[0].style.overflow="auto";
621 - html[0].style.overflow="auto";
622622
 623+ if ( jQuery.browser.msie ) {
 624+ iframe[0].style.overflow="auto";
 625+ html[0].style.overflow="auto";
 626+ } else {
 627+ iframe[0].style.overflow="visible";
 628+ html[0].style.overflow="visible";
 629+ }
 630+
623631 if ( jQuery.browser.mozilla ) {
624632 content
625633 .width ( contW )
@@ -638,13 +646,29 @@
639647 .height ( frameH );
640648
641649 with ( container[0].style ) {
642 - top = (( - frameH ) / 2) + "px";
643 - left = (( - frameW ) / 2) + "px";
 650+ top = (Math.floor(( - frameH ) / 2)) + "px";
 651+ left = (Math.floor(( - frameW ) / 2)) + "px";
 652+ }
 653+
 654+ setTimeout(function(){
 655+ if ( jQuery.browser.msie ) {
 656+ iframe[0].style.overflow="auto";
 657+ html[0].style.overflow="auto";
 658+ } else {
 659+ iframe[0].style.overflow="visible";
 660+ html[0].style.overflow="visible";
644661 }
 662+ }, 100);
645663
646 - content
647 - .width ( 'auto' )
648 - .height ( 'auto' );
 664+ if ( jQuery.browser.mozilla ) {
 665+ content
 666+ .width ( contW )
 667+ .height ( contH );
 668+ } else {
 669+ content
 670+ .width ( 'auto' )
 671+ .height ( 'auto' );
 672+ }
649673
650674 }
651675 } else {
@@ -652,6 +676,15 @@
653677 .width ( 'auto' )
654678 .height ( 'auto' );
655679
 680+ if ( jQuery.browser.safari ) { // Google chrome needs a kick
 681+
 682+ // turn scrollbars off and on again to really only show them when needed
 683+ html[0].style.overflow="hidden";
 684+
 685+ setTimeout(function(){
 686+ html[0].style.overflow="visible";
 687+ }, 1);
 688+ }
656689 }
657690
658691 scrollTgt