Using Fabric.js I am working with a text object that I have named header. When the header area is selected a div is faded in with two input fields that can be used to set text and fill. This is working for me.
What I am attempting to handle next, is when deselecting the header object, I will fade out my div. What is the proper way to handle header.off()?
header.on('selected', function() {
$('#header-text-edit').fadeIn('fast');
// watch for header.input changes
scope.$watch("header.input", function(value) {
header.text = scope.header.input;
});
// watch for header.color changes
scope.$watch("header.color", function(value) {
header.fill = scope.header.color;
});
});
header.off()
would be used to remove event handlers. It doesn't have anything to do with the opposite of an event.on()
adds an event handler,off()
removes it.