Sha256: f348e1596ceefb877f01cb4514a5073898c5acb7dbd90d64a5b82b454bea4a50

Contents?: true

Size: 1.52 KB

Versions: 28

Compression:

Stored size: 1.52 KB

Contents

// = require_self

$("#result_decidim_accountability_status_id").change(function () {
  /* eslint-disable no-invalid-this */
  const progress = $(this).find(":selected").data("progress")
  if (progress || progress === 0) {
    $("#result_progress").val(progress);
  }
});

$(function() {
  $(document).on("open.zf.reveal", "#data_picker-modal", function () {
    let xhr = null;

    $("#data_picker-autocomplete").autoComplete({
      minChars: 2,
      source: function(term, response) {
        try {
          xhr.abort();
        } catch (exception) { xhr = null}

        let url = $("#proposal-picker-choose").attr("href")
        xhr = $.getJSON(
          url,
          { term: term },
          function(data) { response(data); }
        );
      },
      renderItem: function (item, search) {
        let sanitizedSearch = search.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
        let re = new RegExp(`(${sanitizedSearch.split(" ").join("|")})`, "gi");
        let title = item[0]
        let modelId = item[1]
        let val = `#${modelId}- ${title}`;
        return `<div class="autocomplete-suggestion" data-model-id="${modelId}" data-val ="${title}">${val.replace(re, "<b>$1</b>")}</div>`;
      },
      onSelect: function(event, term, item) {
        let choose = $("#proposal-picker-choose")
        let modelId = item.data("modelId")
        let val = `#${modelId}- ${item.data("val")}`;
        choose.data("picker-value", modelId)
        choose.data("picker-text", val)
        choose.data("picker-choose", "")
      }
    })
  });
})

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
decidim-accountability-0.21.0 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.20.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.20.0 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.19.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.18.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.19.0 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.17.2 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.18.0 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.17.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.16.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.17.0 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.16.0 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.15.2 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.15.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.15.0 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.14.4 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.14.3 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.14.2 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.14.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6
decidim-accountability-0.13.1 app/assets/javascripts/decidim/accountability/admin/accountability_admin.js.es6