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