Sha256: 3950a42ff2362e4c2800181122d445bdf5c0664ba6b6fddac4d9f6b99e31bdce
Contents?: true
Size: 663 Bytes
Versions: 85
Compression:
Stored size: 663 Bytes
Contents
Spree.Views.Cart.EmptyCartButton = Backbone.View.extend({ initialize: function() { this.listenTo(this.collection, 'update', this.render); this.render(); }, events: { "click": "onClick" }, onClick: function(e) { e.preventDefault() if (!confirm(Spree.translations.are_you_sure_delete)) { return; } this.model.empty({ success: function () { this.collection.reset() this.collection.push({}) }.bind(this) }) }, render: function() { var isNew = function (item) { return item.isNew() }; this.$el.prop("disabled", !this.collection.length || this.collection.some(isNew)); } });
Version data entries
85 entries across 85 versions & 1 rubygems