Sha256: 27a4b84e4509345bcf6cf2f88f8461880ec4514cebbca1a781b14b7a7b800ad5

Contents?: true

Size: 779 Bytes

Versions: 3

Compression:

Stored size: 779 Bytes

Contents

$(function() {
  const datasetPath = $('#timeline').data('dataset-path');
  if (!datasetPath) {
    return;
  }

  const container = $('#timeline');
  const options = {
    zoomable: false,
    orientation: 'both',
    order(a, b) {
      return a.end - b.end;
    }
  };
  let timeline = null;

  const callback = function(response) {
    if (timeline === null) {
      return timeline = new vis.Timeline(
        container.get(0),
        response.data,
        $.extend(options, {start: response.start, end: response.end})
      );
    } else {
      timeline.setItems(response.data);
      return timeline.setOptions({start: response.start, end: response.end});
    }
  };

  $.get(datasetPath, callback);
  return setInterval(() => $.get(datasetPath, callback), 10000);
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kuroko2-0.8.0 app/assets/javascripts/kuroko2/job_timelines.js
kuroko2-0.7.0 app/assets/javascripts/kuroko2/job_timelines.js
kuroko2-0.6.0 app/assets/javascripts/kuroko2/job_timelines.js