Sha256: 252c977755c0703028e8c18895717ea7b9dc733421e31af011986ce07758492c
Contents?: true
Size: 658 Bytes
Versions: 16
Compression:
Stored size: 658 Bytes
Contents
Spree.PromotionActivationView = Backbone.View.extend({ events: { "change [name=activation_type]": "render" }, initialize: function(){ this.render(); }, render: function(){ var activation_type = this.$("[name=activation_type]:checked").val(); this.$('[data-activation-type]').each(function(){ var selected = ($(this).data('activation-type') === activation_type); $(this).find(':input').prop("disabled", !selected); $(this).toggle(selected); }); } }); $(function(){ if($("#js_promotion_activation").length) { new Spree.PromotionActivationView({ el: $("#js_promotion_activation") }); } });
Version data entries
16 entries across 16 versions & 1 rubygems