Sha256: 93462c32c9eba6eaee002bc48ad035b13f3a74df421ec6bd538a4980238ca906

Contents?: true

Size: 904 Bytes

Versions: 25

Compression:

Stored size: 904 Bytes

Contents

$(document).ready(function() {
  $("body").on("keypress", "#addGroupInput", function(e) {
    $("#addGroupInput").val($("#addGroupInput").val().toLowerCase().replace(" ", "-"));
    if (e.which === 13) {
      e.preventDefault();
      $(".addGroupInput").trigger("click");
    }
  });
  $("body").on("click", ".addGroupInput", function() {
    $.ajax({
      type: "POST",
      url: $('.js-settings').attr('data-site-url') + "admin/settings/create_user_group",
      data: "key=" + $("#addGroupInput").val(),
      dataType: "html",
      success: function(data) {
        $(".userGroupOptions").append(data);
        $("#addGroupInput").val("");
      }
    });
  });
  $("body").on("click", ".remove-user-group", function(e) {
    e.preventDefault();
    if (confirm("Are you sure? Please make sure update all users with this group")) {
      $(this).closest(".form-group").remove();
    }
  });
});

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
roroacms-0.0.7.4 app/assets/javascripts/roroacms/admin/settings/settings.js
roroacms-0.0.7.3 app/assets/javascripts/roroacms/admin/settings/settings.js
roroacms-0.0.7.2 app/assets/javascripts/roroacms/admin/settings/settings.js
roroacms-0.0.7.1 app/assets/javascripts/roroacms/admin/settings/settings.js
roroacms-0.0.7 app/assets/javascripts/roroacms/admin/settings/settings.js