r59785 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59784‎ | r59785 | r59786 >
Date:13:07, 7 December 2009
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads AJAX:
* Reload Table of Contents after replies as well as after new posts.
* Have TOC maintain its height while reloading, to minimise scrolling annoyance
Modified paths:
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/lqt.js
@@ -883,12 +883,6 @@
884884 'slow');
885885 }
886886 );
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(); } );
893887 }
894888
895889 var doneCallback = function(data) {
@@ -926,6 +920,9 @@
927921 editform.empty().hide();
928922
929923 callback(data);
 924+
 925+ // Load the new TOC
 926+ liquidThreads.reloadTOC();
930927 };
931928
932929 if ( type == 'reply' ) {
@@ -941,6 +938,17 @@
942939 }
943940 },
944941
 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+
945953 'doNewThread' : function( talkpage, subject, text, summary, callback, bump ) {
946954 liquidThreads.getToken(
947955 function(token) {

Status & tagging log