File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -722,7 +722,7 @@ var DataStore = new function () {
722722 } ) ;
723723
724724 self . create_event_source ( ) ;
725- self . init_selections ( ) ;
725+ self . init_callback ( ) ;
726726 } ;
727727
728728 self . update_rank = function ( u_id , user ) {
@@ -786,8 +786,8 @@ var DataStore = new function () {
786786 - they also start an AJAX request and process its data
787787 - when BOTH requests finish init_scores() is called
788788 - it does again an AJAX request and processes its data
789- - at the end it calls init_ranks() which calls init_selections() which,
790- in turn, calls init_callback()
789+ - at the end it calls init_ranks() which calls init_callback()
790+ - Subsequently, when TeamStore is initialized, we call init_selections().
791791 */
792792
793793 self . init = function ( callback ) {
@@ -1157,8 +1157,6 @@ var DataStore = new function () {
11571157 }
11581158 }
11591159 } ) ;
1160-
1161- self . init_callback ( ) ;
11621160 } ;
11631161
11641162 self . set_selected = function ( u_id , flag , color_idx ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ $(document).ready(function() {
4040 HistoryStore . init ( ) ;
4141 UserDetail . init ( ) ;
4242 TimeView . init ( ) ;
43- TeamSearch . init ( ) ;
43+ TeamSearch . init ( function ( ) {
44+ DataStore . init_selections ( ) ;
45+ } ) ;
4446 Overview . init ( ) ;
4547 Scoreboard . init ( ) ;
4648 } ) ;
Original file line number Diff line number Diff line change 1818var TeamSearch = new function ( ) {
1919 var self = this ;
2020
21- self . init = function ( ) {
21+ self . init = function ( callback ) {
2222 $ ( "#TeamSearch_input" ) . focus ( function ( ) {
2323 self . show ( ) ;
2424 } ) ;
@@ -98,6 +98,7 @@ var TeamSearch = new function () {
9898 self . update ( ) ;
9999
100100 DataStore . select_events . add ( self . select_handler ) ;
101+ callback ( ) ;
101102 } ;
102103
103104 self . generate = function ( ) {
You can’t perform that action at this time.
0 commit comments