Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.css |
— | — | @@ -26,6 +26,10 @@ |
27 | 27 | text-align: center; |
28 | 28 | } |
29 | 29 | |
| 30 | +.articleFeedbackv5-error-wrap { |
| 31 | + position: relative; |
| 32 | +} |
| 33 | + |
30 | 34 | .articleFeedbackv5-error { |
31 | 35 | display: none; |
32 | 36 | position: absolute; |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -174,17 +174,13 @@ |
175 | 175 | </div>\ |
176 | 176 | </div>\ |
177 | 177 | </div>\ |
178 | | - <div class="articleFeedbackv5-error"><div class="articleFeedbackv5-error-message"></div></div>\ |
179 | | - <div style="clear:both;"></div>\ |
180 | 178 | </div>\ |
181 | 179 | ', |
182 | 180 | |
183 | | - dialogInner: '\ |
184 | | - <div class="articleFeedbackv5-dialog-inner">\ |
185 | | - <div class="articleFeedbackv5-buffer">\ |
| 181 | + errorPanel: '<div class="articleFeedbackv5-error-wrap">\ |
| 182 | + <div class="articleFeedbackv5-error">\ |
| 183 | + <div class="articleFeedbackv5-error-message"></div>\ |
186 | 184 | </div>\ |
187 | | - <div class="articleFeedbackv5-error"><div class="articleFeedbackv5-error-message"></div></div>\ |
188 | | - <div style="clear:both;"></div>\ |
189 | 185 | </div>\ |
190 | 186 | ', |
191 | 187 | |
— | — | @@ -2137,6 +2133,7 @@ |
2138 | 2134 | // Add it to the page |
2139 | 2135 | $.articleFeedbackv5.$holder |
2140 | 2136 | .html( $wrapper ) |
| 2137 | + .append( $( $.articleFeedbackv5.templates.errorPanel ) ) |
2141 | 2138 | .append( '<div class="articleFeedbackv5-lock"></div>' ); |
2142 | 2139 | |
2143 | 2140 | // Add an empty dialog |
— | — | @@ -2343,19 +2340,33 @@ |
2344 | 2341 | */ |
2345 | 2342 | $.articleFeedbackv5.markShowstopperError = function ( message ) { |
2346 | 2343 | aft5_debug( message ); |
2347 | | - var $err = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-error-message' ); |
| 2344 | + if ( $.articleFeedbackv5.inDialog ) { |
| 2345 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'title', '' ); |
| 2346 | + $.articleFeedbackv5.$dialog.dialog( 'option', 'close', function () { |
| 2347 | + $.articleFeedbackv5.clear(); |
| 2348 | + } ); |
| 2349 | + $.articleFeedbackv5.$dialog.find( '.articleFeedbackv5-ui' ).remove(); |
| 2350 | + $( '#ui-dialog-title-articleFeedbackv5-dialog-wrap' ).parent() |
| 2351 | + .find( '.articleFeedbackv5-tooltip-trigger' ).remove(); |
| 2352 | + $.articleFeedbackv5.$dialog.append( $( '<div class="articleFeedbackv5-error-message"></div>' ) ); |
| 2353 | + $.articleFeedbackv5.find( '.articleFeedbackv5-error' ).show(); |
| 2354 | + } else { |
| 2355 | + var $veil = $.articleFeedbackv5.find( '.articleFeedbackv5-error' ); |
| 2356 | + var $box = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-panel' ); |
| 2357 | + $veil.css( 'top', '-' + $box.height() ); |
| 2358 | + $veil.css( 'width', $box.width() ); |
| 2359 | + $veil.css( 'height', $box.height() ); |
| 2360 | + $veil.show(); |
| 2361 | + $box.css( 'width', $box.width() ); |
| 2362 | + $box.css( 'height', $box.height() ); |
| 2363 | + $box.html( '' ); |
| 2364 | + } |
| 2365 | + var $err = $.articleFeedbackv5.find( '.articleFeedbackv5-error-message' ); |
2348 | 2366 | $err.text( $.articleFeedbackv5.debug && message ? message : mw.msg( 'articlefeedbackv5-error' ) ); |
2349 | 2367 | $err.html( $err.html().replace( "\n", '<br />' ) ); |
2350 | | - var $veil = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-error' ); |
2351 | | - var $box = $.articleFeedbackv5.$holder.find( '.articleFeedbackv5-buffer' ); |
2352 | | - // TODO: Make this smarter -- on ubuntu/ff at least, using the |
2353 | | - // offset puts it about 100px down from where it should be; |
2354 | | - // this math corrects for it, but will most likely be wrong on |
2355 | | - // other browsers |
2356 | | - $veil.css('top', $box.find('.articleFeedbackv5-ui').offset().top / 2 + 10); |
2357 | | - $veil.css('width', $box.width()); |
2358 | | - $veil.css('height', $box.height()); |
2359 | | - $veil.show(); |
| 2368 | + $.articleFeedbackv5.$toRemove.remove(); |
| 2369 | + $.articleFeedbackv5.$toRemove = $( [] ); |
| 2370 | + $.articleFeedbackv5.nowShowing = 'none'; |
2360 | 2371 | }; |
2361 | 2372 | |
2362 | 2373 | // }}} |