Sha256: 4bd6ffda99c1ba5b92cd3644110cbd95001e561d5dd9240deecc7c13d4a8c3db

Contents?: true

Size: 892 Bytes

Versions: 16

Compression:

Stored size: 892 Bytes

Contents

mumuki.progress = (() => {
  /**
   * Updates the current exercise progress indicator
   *
   * @param {SubmissionResult} data
   * */
  function updateProgressBarAndShowModal(data) {
    $('.progress-list-item.active').attr('class', data.class_for_progress_list_item);
    if(data.guide_finished_by_solution) $('#guide-done').modal();
  }

  /**
   * Update all links in the progress bar with the given function
   *
   * @param {(anchor: JQuery) => string} f
   */
  function updateWholeProgressBar(f) {
    $('.progress-list-item').each((_, it) => {
      const $anchor = $(it);
      $anchor.attr('class', f($anchor));
    });
  }

  return {
    updateProgressBarAndShowModal,
    updateWholeProgressBar
  };
})();

/** @deprecated use {@code mumuki.progress.updateProgressBarAndShowModal} instead */
mumuki.updateProgressBarAndShowModal = mumuki.progress.updateProgressBarAndShowModal;

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mumuki-laboratory-9.0.6 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-9.0.5 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-9.0.4 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-9.0.3 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-9.0.2 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-9.0.1 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-9.0.0 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.6.1 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.6.0 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.5.0 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.4.0 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.3.0 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.2.1 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.2.0 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.1.3 app/assets/javascripts/mumuki_laboratory/application/progress.js
mumuki-laboratory-8.1.2 app/assets/javascripts/mumuki_laboratory/application/progress.js