Changeset 105
- Timestamp:
- 08/09/07 16:10:22 (17 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
CHANGELOG (modified) (1 diff)
-
js/hellaworld.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGELOG
r104 r105 1 1.8 2 3 * Fixed a couple of Javascript bugs, one would cause a drag and drop sort 4 to say an error had occured despite it having completed successfully if 5 there were no finished items and finished items were set to display. 6 The second javascript bug involved the 15 second refresh, instead of 7 re-creating the existing timer, it was creating a new one for each 8 refresh, meaning after a while it was refreshing every second or so. 9 1 10 1.7 2 11 -
trunk/js/hellaworld.js
r98 r105 13 13 14 14 function startRefresher() { 15 refresh = true; 16 setTimeout('refresher()', 15000); 15 if (refresh) { 16 clearTimeout(refresh); 17 } 18 refresh = setTimeout('refresher()', 15000); 17 19 } 18 20 19 21 function stopRefresher() { 20 refresh = false; 22 if (refresh) { 23 clearTimeout(refresh); 24 refresh = false; 25 } 21 26 } 22 27 … … 35 40 updateData(json); 36 41 }, 37 error : function( ) {42 error : function(foo, bar, wee) { 38 43 alert('Apologies, there was an error while making the request'); 39 44 } … … 93 98 makeSortable(); 94 99 } 95 if (json.finished ) {100 if (json.finished && json.finished.length > 0) { 96 101 var finished = ''; 97 102 for (i = 0; i < json.finished.length; i++) { … … 118 123 if (refresh) { 119 124 $.getJSON('index.php?refresher=1', function(json) { updateData(json); }); 120 setTimeout('refresher()', 15000); 125 clearTimeout(refresh); 126 refresh = setTimeout('refresher()', 15000); 121 127 } 122 128 }
