Sha256: ce791db3ea801a88db23d3bd528abb7c598ec96322189f641fe1612e330d06c3
Contents?: true
Size: 697 Bytes
Versions: 5
Compression:
Stored size: 697 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) || this.model.get("completed_at")); } });
Version data entries
5 entries across 5 versions & 1 rubygems