Sha256: dbc1f982916726b4f949889345f56b723d732c10fa3b01d4e5869f1a5d4f2b33

Contents?: true

Size: 645 Bytes

Versions: 137

Compression:

Stored size: 645 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);
    });
  }
})

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

Version data entries

137 entries across 137 versions & 2 rubygems

Version Path
solidus_backend-4.4.1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.4.0 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.3.4 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.2.4 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.1.5 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.3.3 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.3.2 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.1.4 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.3.1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.3.0 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.2.3 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.1.3 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.0.4 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-3.4.6 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.0.3 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.1.2 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.2.2 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-3.4.5 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.2.1 app/assets/javascripts/spree/backend/calculator.js
solidus_backend-4.2.0 app/assets/javascripts/spree/backend/calculator.js