Sha256: 9ac37ba421ca50e3894a49e934c2a122324e9acef5920968f88439093c08a76a

Contents?: true

Size: 1.41 KB

Versions: 1

Compression:

Stored size: 1.41 KB

Contents

I"“(function() {
  var TransferItemDeleting;

  TransferItemDeleting = (function() {
    var errorHandler, successHandler;

    function TransferItemDeleting() {}

    TransferItemDeleting.beginListening = function() {
      return $('body').on('click', '#listing_transfer_items [data-action="remove"]', (function(_this) {
        return function(ev) {
          var stockTransferNumber, transferItem, transferItemId;
          ev.preventDefault();
          if (confirm(Spree.translations.are_you_sure_delete)) {
            transferItemId = $(ev.currentTarget).data('id');
            stockTransferNumber = $("#stock_transfer_number").val();
            transferItem = new Spree.TransferItem({
              id: transferItemId,
              stockTransferNumber: stockTransferNumber
            });
            return transferItem.destroy(successHandler, errorHandler);
          }
        };
      })(this));
    };

    successHandler = function(transferItem) {
      $("[data-transfer-item-id='" + transferItem.id + "']").remove();
      return show_flash("success", Spree.translations.deleted_successfully);
    };

    errorHandler = function(errorData) {
      return show_flash("error", errorData.responseText);
    };

    return TransferItemDeleting;

  })();

  if (Spree.StockTransfers == null) {
    Spree.StockTransfers = {};
  }

  Spree.StockTransfers.TransferItemDeleting = TransferItemDeleting;

}).call(this);
:ET

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alchemy-solidus-2.2.0 spec/dummy/tmp/cache/assets/sprockets/v3.0/-f/-F3HQ1X6aQpyzwIr1CdR8QN2Y1pHljqHoUqVM_khZPU.cache