timeline/js/timeline.js
changeset 99 281ef3fd6f84
parent 98 abead2de6332
child 101 05c1161fa501
equal deleted inserted replaced
98:abead2de6332 99:281ef3fd6f84
   478     this.drawOccurrences();
   478     this.drawOccurrences();
   479 };
   479 };
   480 
   480 
   481 Tlns.Classes.Timeline.prototype.loadOccurrences = function() {
   481 Tlns.Classes.Timeline.prototype.loadOccurrences = function() {
   482     var _this = this;
   482     var _this = this;
   483     $.getJSON(this.api_endpoint, {
   483     
   484         method: this.api_method,
   484     function getData(cursor) {
   485         api_key: this.token,
   485         $.getJSON(_this.api_endpoint, {
   486         mail: this.email
   486             method: _this.api_method,
   487     }, function(_data) {
   487             api_key: _this.token,
   488         console.log(_data);
   488             mail: _this.email,
   489         _this.onOccurrencesLoaded(_data);
   489             cursor: cursor
   490     });
   490         }, function(_data) {
       
   491             _this.onOccurrencesLoaded(_data);
       
   492             if (_data.cursor.hasNext) {
       
   493                 getData(_data.cursor.next);
       
   494             }
       
   495         });
       
   496     }
       
   497     
       
   498     getData();
   491     
   499     
   492 };
   500 };
   493 
   501 
   494 Tlns.Classes.Timeline.prototype.onOccurrencesLoaded = function(_data) {
   502 Tlns.Classes.Timeline.prototype.onOccurrencesLoaded = function(_data) {
   495     for (var _i = 0; _i < _data.data.length; _i++) {
   503     for (var _i = 0; _i < _data.data.length; _i++) {