Marvin
02/28/2023, 10:16 AMcart.on("afterAddLine", function() {
// do something
});
Then I tried moving it to the entry point and it triggers once, but then I try to pass an event to the view and again it is triggered 3 times.
In the Entry Point I have the following.
cart.on("afterAddLine", function() {
Backbone.trigger("change:total_weight");
});
Then in the view I have the following.
Backbone.on("change:total_weight", function() {
self.calculateTotalWeight();
});
Steve Goldberg
02/28/2023, 11:30 AMSteve Goldberg
02/28/2023, 11:30 AMMarvin
02/28/2023, 6:54 PMBackbone.once
and it still triggers 3 times, but not _.once()
.