don't bother firing hooks received by js unless a listener exists

This commit is contained in:
Julian Lam
2014-01-29 12:28:21 -05:00
parent 133188f14c
commit 38ee3fd5a3
2 changed files with 14 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ define(['uploader'], function(uploader) {
Settings.prepare();
};
Settings.prepare = function() {
Settings.prepare = function(callback) {
// Come back in 125ms if the config isn't ready yet
if (!app.config) {
setTimeout(function() {
@@ -117,6 +117,10 @@ define(['uploader'], function(uploader) {
$(this).tab('show');
return false;
});
if (typeof callback === 'function') {
callback();
}
};
Settings.remove = function(key) {