Ability to resize avatars before uploading them

This commit is contained in:
yflory
2017-12-04 15:03:43 +01:00
parent c59c6072f3
commit f52d987515
7 changed files with 73 additions and 6 deletions

View File

@@ -98,7 +98,13 @@ define([
target: data.target
};
if (data.filter && !data.filter(file)) {
UI.log('Invalid avatar (type or size)');
return;
}
if (data.transformer) {
data.transformer(file, function (newFile) {
data.FM.handleFile(newFile, ev);
if (callback) { callback(); }
});
return;
}
data.FM.handleFile(file, ev);