Closed devtrends closed 11 years ago
I like this idea. Do you mean creating a custom event, or adding callback functions like onSizeError()
and onExtError()
for handling those situations?
Adding callback functions is super easy - 4 lines of code total. I added a branch "develop" and changed the demo to use the callbacks (it has the same behavior with the alerts because I'm manually calling _errorMsg()
but you could obv do anything).
Here's the code from the demo:
onExtError: function(filename, extension) {
this._errorMsg('ext');
},
onSizeError: function(filename, fileSize) {
this._errorMsg('size');
},
An added bonus is that _errorMsg()
can be removed, resulting in 29 fewer lines of code.
Thoughts?
would be nice if event was raised instead passing through filename. then could handle any way we like.