r66163 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66162‎ | r66163 | r66164 >
Date:21:18, 10 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Non-working JS change
Modified paths:
  • /trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/storyboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js
@@ -27,7 +27,8 @@
2828 endDelay: 100,
2929 updateBatch: null,
3030 updateEnd: null,
31 - loaded: false
 31+ loaded: false,
 32+ continueParam: ''
3233 },
3334 opt
3435 );
@@ -99,10 +100,12 @@
100101 * function if this is the case.
101102 */
102103 function handleScrolling() {
 104+ if ( !opt.loaded ) return;
 105+
103106 var scrollPos = $me.scrollTop();
104107
105108 // TODO: add check to make sure the board is not currently busy
106 - if( previousScrollPos != scrollPos ) {
 109+ if ( previousScrollPos != scrollPos ) {
107110 previousScrollPos = scrollPos;
108111 var co = $me.offset().top;
109112
@@ -117,7 +120,8 @@
118121 return;
119122 }
120123
121 - opt.updateBatch( $batchDiv.removeClass( opt.emptyBatchClass ) );
 124+ opt.loaded = false;
 125+ opt.updateBatch( opt, $batchDiv.removeClass( opt.emptyBatchClass ) );
122126 });
123127 }
124128
Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
@@ -17,7 +17,7 @@
1818 } );
1919 } );
2020
21 - function updateStoryboard( $storyboard ) {
 21+ function updateStoryboard( ajaxscrollObj, $storyboard ) {
2222 requestArgs = {
2323 'action': 'query',
2424 'list': 'stories',
@@ -26,15 +26,15 @@
2727 'stlanguage': window.storyboardLanguage
2828 };
2929
30 - if ( window.storyContinueParam ) {
31 - requestArgs.stcontinue = window.storyContinueParam.stories.stcontinue;
 30+ if ( ajaxscrollObj.continueParam ) {
 31+ requestArgs.stcontinue = ajaxscrollObj.continueParam;
3232 }
3333
3434 $.getJSON( wgScriptPath + '/api.php',
3535 requestArgs,
3636 function( data ) {
3737 if ( data.query ) {
38 - addStories( $storyboard, data );
 38+ addStories( ajaxscrollObj, $storyboard, data );
3939 } else {
4040 alert( stbMsgExt( 'storyboard-anerroroccured', [data.error.info] ) );
4141 }
@@ -42,7 +42,7 @@
4343 );
4444 }
4545
46 - function addStories( $storyboard, data ) {
 46+ function addStories( ajaxscrollObj, $storyboard, data ) {
4747 // Remove the empty boxes.
4848 $storyboard.html( '' );
4949
@@ -127,7 +127,8 @@
128128 $storyboard.append( $storyBody );
129129 }
130130
131 - window.storyContinueParam = data["query-continue"] ? data["query-continue"] : false;
 131+ ajaxscrollObj.continueParam = data["query-continue"] ? data["query-continue"].stories.stcontinue : false;
 132+ ajaxscrollObj.loaded = true;
132133 }
133134
134135 })(jQuery);
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r66165Follow up to r66163jeroendedauw21:59, 10 May 2010

Status & tagging log