Sha256: 8053fbd4f603e0bcf85dd406b0d6c2021b908e1c3457bf21d22618ac05468ed7

Contents?: true

Size: 1.35 KB

Versions: 3

Compression:

Stored size: 1.35 KB

Contents

$(function () {
  $(document).on("click", ".js-toggle-trigger", function () {
    var $container = $(this).closest(".js-toggle-container");
    return $container.toggleClass("toggle-on");
  });

  $("#enable_feature__button").on("click", function (e) {
    const featureName = $(e.target).data("confirmation-text");
    const promptMessage = prompt(
      `Are you sure you want to fully enable this feature for everyone? Please enter the name of the feature to confirm it: ${featureName}`
    );

    if (promptMessage !== featureName) {
      e.preventDefault();
    }
  });

  $("#disable_feature__button").on("click", function (e) {
    const featureName = $(e.target).data("confirmation-text");
    const promptMessage = prompt(
      `Are you sure you want to disable this feature for everyone? Please enter the name of the feature to confirm it: ${featureName}`
    );

    if (promptMessage !== featureName) {
      e.preventDefault();
    }
  });

  $("#delete_feature__button").on("click", function (e) {
    const featureName = $(e.target).data("confirmation-text");
    const promptMessage = prompt(
      `Are you sure you want to remove this feature from the list of features and disable it for everyone? Please enter the name of the feature to confirm it: ${featureName}`
    );
    
    if (promptMessage !== featureName) {
      e.preventDefault();
    }
  });
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flipper-ui-1.2.2 lib/flipper/ui/public/js/application.js
flipper-ui-1.2.1 lib/flipper/ui/public/js/application.js
flipper-ui-1.2.0 lib/flipper/ui/public/js/application.js