I have this event in my view:
events:
"click" : "clickContainer"
How can I unbind/bind (able and disable) temporary the click event in the same View?
I have this event in my view:
events:
"click" : "clickContainer"
How can I unbind/bind (able and disable) temporary the click event in the same View?
kalley
On
I would have a property on the view. Something like this:
var View = Marionette.ItemView.extend({
initialize: function() {
this.clickEnabled = true;
},
events: {
'click': 'clickContainer'
},
clickContainer: function() {
if ( this.clickEnabled ) {
// do stuff
}
}
});
then you just change that property when you want to change the state.
Copyright © 2021 Jogjafile Inc.
Another option is to remove the events map and use the manual version of what the events map sets up.