Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js |
— | — | @@ -27,7 +27,8 @@ |
28 | 28 | endDelay: 100, |
29 | 29 | updateBatch: null, |
30 | 30 | updateEnd: null, |
31 | | - loaded: false |
| 31 | + loaded: false, |
| 32 | + continueParam: '' |
32 | 33 | }, |
33 | 34 | opt |
34 | 35 | ); |
— | — | @@ -99,10 +100,12 @@ |
100 | 101 | * function if this is the case. |
101 | 102 | */ |
102 | 103 | function handleScrolling() { |
| 104 | + if ( !opt.loaded ) return; |
| 105 | + |
103 | 106 | var scrollPos = $me.scrollTop(); |
104 | 107 | |
105 | 108 | // TODO: add check to make sure the board is not currently busy |
106 | | - if( previousScrollPos != scrollPos ) { |
| 109 | + if ( previousScrollPos != scrollPos ) { |
107 | 110 | previousScrollPos = scrollPos; |
108 | 111 | var co = $me.offset().top; |
109 | 112 | |
— | — | @@ -117,7 +120,8 @@ |
118 | 121 | return; |
119 | 122 | } |
120 | 123 | |
121 | | - opt.updateBatch( $batchDiv.removeClass( opt.emptyBatchClass ) ); |
| 124 | + opt.loaded = false; |
| 125 | + opt.updateBatch( opt, $batchDiv.removeClass( opt.emptyBatchClass ) ); |
122 | 126 | }); |
123 | 127 | } |
124 | 128 | |
Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | } ); |
19 | 19 | } ); |
20 | 20 | |
21 | | - function updateStoryboard( $storyboard ) { |
| 21 | + function updateStoryboard( ajaxscrollObj, $storyboard ) { |
22 | 22 | requestArgs = { |
23 | 23 | 'action': 'query', |
24 | 24 | 'list': 'stories', |
— | — | @@ -26,15 +26,15 @@ |
27 | 27 | 'stlanguage': window.storyboardLanguage |
28 | 28 | }; |
29 | 29 | |
30 | | - if ( window.storyContinueParam ) { |
31 | | - requestArgs.stcontinue = window.storyContinueParam.stories.stcontinue; |
| 30 | + if ( ajaxscrollObj.continueParam ) { |
| 31 | + requestArgs.stcontinue = ajaxscrollObj.continueParam; |
32 | 32 | } |
33 | 33 | |
34 | 34 | $.getJSON( wgScriptPath + '/api.php', |
35 | 35 | requestArgs, |
36 | 36 | function( data ) { |
37 | 37 | if ( data.query ) { |
38 | | - addStories( $storyboard, data ); |
| 38 | + addStories( ajaxscrollObj, $storyboard, data ); |
39 | 39 | } else { |
40 | 40 | alert( stbMsgExt( 'storyboard-anerroroccured', [data.error.info] ) ); |
41 | 41 | } |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | ); |
44 | 44 | } |
45 | 45 | |
46 | | - function addStories( $storyboard, data ) { |
| 46 | + function addStories( ajaxscrollObj, $storyboard, data ) { |
47 | 47 | // Remove the empty boxes. |
48 | 48 | $storyboard.html( '' ); |
49 | 49 | |
— | — | @@ -127,7 +127,8 @@ |
128 | 128 | $storyboard.append( $storyBody ); |
129 | 129 | } |
130 | 130 | |
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; |
132 | 133 | } |
133 | 134 | |
134 | 135 | })(jQuery); |
\ No newline at end of file |