Sha256: f84c90226314f8f63f411735bfdaf44fb6df3a3e352b3af69db8eb44cfa2ffea

Contents?: true

Size: 891 Bytes

Versions: 138

Compression:

Stored size: 891 Bytes

Contents

Spree.Views.Payment.PaymentRow = Backbone.View.extend({
  events: {
    "click .js-edit": "onEdit",
    "click .js-save": "onSave",
    "submit form": "onSave",
    "click .js-cancel": "onCancel"
  },

  onEdit: function(e) {
    e.preventDefault();
    this.$el.addClass("editing");
  },

  onCancel: function(e) {
    e.preventDefault();
    this.$el.removeClass("editing");
  },

  onSave: function(e) {
    var view = this;
    var amount = this.$(".js-edit-amount").val();
    var options = {
      success: function(model, response, options) {
        view.$(".js-display-amount").text(model.attributes.display_amount);
        view.$el.removeClass("editing");
      },
      error: function(model, response, options) {
        show_flash('error', response.responseJSON.error);
      }
    };
    e.preventDefault();
    this.model.save({
      amount: amount
    }, options);
  }
});

Version data entries

138 entries across 138 versions & 2 rubygems

Version Path
solidus_backend_devise_token_auth-2.8.0.alpha.11 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.10 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.9 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.8 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.7 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.6 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.5 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.4 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.3 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend_devise_token_auth-2.8.0.alpha.2 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.7.0 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.6.1 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.6.0 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.6.0.rc1 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.5.0 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.5.0.rc1 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.5.0.beta2 app/assets/javascripts/spree/backend/views/payment/payment_row.js
solidus_backend-2.5.0.beta1 app/assets/javascripts/spree/backend/views/payment/payment_row.js