Sha256: 9d0cce45daa3347bf5487491cdd96498b6b539905e7b577189c5b398ef8b46fd

Contents?: true

Size: 635 Bytes

Versions: 16

Compression:

Stored size: 635 Bytes

Contents

Spree.CalculatorEditView = Backbone.View.extend({
  events: {
    "change .js-calculator-type": "render",
  },

  initialize: function() {
    this.render();
  },

  render: function() {
    var selected_class = this.$('.js-calculator-type option:selected').val();
    this.$('.js-calculator-preferences').each(function() {
      var selected = ($(this).data('calculator-type') === selected_class);
      $(this).find(':input').prop("disabled", !selected);
      $(this).toggle(selected);
    });
  }
})

$(function() {
  $('.js-calculator-fields').each(function() {
    new Spree.CalculatorEditView({
      el: this
    });
  });
});

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
solidus_backend-2.4.2 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.4.1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.3.1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.2.2 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.4.0 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.4.0.rc1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.4.0.beta1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.3.0 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.3.0.rc3 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.3.0.rc2 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.3.0.rc1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.3.0.beta1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.2.1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.2.0 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.2.0.rc1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-2.2.0.beta1 app/assets/javascripts/spree/backend/calculator.js