Index: trunk/extensions/UploadWizard/js/mw.UploadWizard.js |
— | — | @@ -1083,7 +1083,7 @@ |
1084 | 1084 | _this.deedDiv |
1085 | 1085 | ); |
1086 | 1086 | |
1087 | | - _this.moreDetailsDiv = $j('<div class="mwe-more-details"></div>').maskSafeHide(); |
| 1087 | + _this.moreDetailsDiv = $j('<div class="mwe-more-details"></div>'); |
1088 | 1088 | |
1089 | 1089 | _this.moreDetailsCtrlDiv = $j( '<div class="mwe-upwiz-details-more-options"></div>' ); |
1090 | 1090 | |
— | — | @@ -2667,7 +2667,6 @@ |
2668 | 2668 | var toggleDiv = $j('<div />'); |
2669 | 2669 | |
2670 | 2670 | var customDiv = $j('<div/>') |
2671 | | - .maskSafeHide() |
2672 | 2671 | .append( |
2673 | 2672 | $j( '<input />') |
2674 | 2673 | .attr( { type: 'checkbox' } ) |
— | — | @@ -2927,6 +2926,8 @@ |
2928 | 2927 | .click( toggle ) |
2929 | 2928 | .data( 'open', false ) |
2930 | 2929 | .append( icon, text ) ); |
| 2930 | + |
| 2931 | + $j( moreDiv ).maskSafeHide(); |
2931 | 2932 | |
2932 | 2933 | }, |
2933 | 2934 | |
— | — | @@ -3104,15 +3105,28 @@ |
3105 | 3106 | * Rather than use display: none, this collapses the divs to zero height |
3106 | 3107 | * This is good because then the elements in the divs still have layout and we can do things like mask and unmask (above) |
3107 | 3108 | * XXX may be obsolete as we are not really doing this any more |
| 3109 | + * disable form fields so we do not tab through them when hidden |
| 3110 | + * XXX for some reason the disabling doesn't work with the date field. |
3108 | 3111 | */ |
3109 | 3112 | |
3110 | 3113 | jQuery.fn.maskSafeHide = function( options ) { |
| 3114 | + $j.each( this.find( ':enabled' ), function(i, input) { |
| 3115 | + $j( input ).data( 'wasEnabled', true ) |
| 3116 | + .attr( 'disabled', 'disabled' ); |
| 3117 | + } ); |
3111 | 3118 | return this.css( { 'height' : '0px', 'overflow' : 'hidden' } ); |
3112 | 3119 | }; |
3113 | 3120 | |
3114 | 3121 | // XXX check overflow properties, is auto/auto not the right thing? |
3115 | 3122 | // may be causing scrollbar to appear when div changes size |
| 3123 | +// re-enable form fields (disabled so we did not tab through them when hidden) |
3116 | 3124 | jQuery.fn.maskSafeShow = function( options ) { |
| 3125 | + $j.each( this.find( ':disabled' ), function (i, input) { |
| 3126 | + if ($j( input ).data( 'wasEnabled' )) { |
| 3127 | + $j( input ).removeAttr( 'disabled' ) |
| 3128 | + .removeData( 'wasEnabled' ); |
| 3129 | + } |
| 3130 | + } ); |
3117 | 3131 | return this.css( { 'height' : 'auto', 'overflow' : 'visible' } ); |
3118 | 3132 | }; |
3119 | 3133 | |