Index: trunk/extensions/LiquidThreads/lqt.js |
— | — | @@ -883,12 +883,6 @@ |
884 | 884 | 'slow'); |
885 | 885 | } |
886 | 886 | ); |
887 | | - |
888 | | - // Load the new TOC |
889 | | - var loadTOCSpinner = $j('<div class="mw-ajax-loader"/>'); |
890 | | - $j('.lqt_toc').empty().append( loadTOCSpinner ); |
891 | | - $j('.lqt_toc').load( window.location.href + ' .lqt_toc > *', |
892 | | - function() { loadTOCSpinner.remove(); } ); |
893 | 887 | } |
894 | 888 | |
895 | 889 | var doneCallback = function(data) { |
— | — | @@ -926,6 +920,9 @@ |
927 | 921 | editform.empty().hide(); |
928 | 922 | |
929 | 923 | callback(data); |
| 924 | + |
| 925 | + // Load the new TOC |
| 926 | + liquidThreads.reloadTOC(); |
930 | 927 | }; |
931 | 928 | |
932 | 929 | if ( type == 'reply' ) { |
— | — | @@ -941,6 +938,17 @@ |
942 | 939 | } |
943 | 940 | }, |
944 | 941 | |
| 942 | + 'reloadTOC' : function() { |
| 943 | + var toc = $j('.lqt_toc'); |
| 944 | + var loadTOCSpinner = $j('<div class="mw-ajax-loader"/>'); |
| 945 | + loadTOCSpinner.css( 'height', toc.height() ); |
| 946 | + toc.empty().append( loadTOCSpinner ); |
| 947 | + toc.load( window.location.href + ' .lqt_toc > *', |
| 948 | + function() { |
| 949 | + loadTOCSpinner.remove(); |
| 950 | + } ); |
| 951 | + }, |
| 952 | + |
945 | 953 | 'doNewThread' : function( talkpage, subject, text, summary, callback, bump ) { |
946 | 954 | liquidThreads.getToken( |
947 | 955 | function(token) { |