Ability to resize avatars before uploading them
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -212,7 +212,9 @@ define([
|
||||
queue.next();
|
||||
};
|
||||
|
||||
var showNamePrompt = true;
|
||||
// Don't show the rename prompt if we don't want to store the file in the drive (avatar)
|
||||
var showNamePrompt = !config.noStore;
|
||||
|
||||
var promptName = function (file, cb) {
|
||||
var extIdx = file.name.lastIndexOf('.');
|
||||
var name = extIdx !== -1 ? file.name.slice(0,extIdx) : file.name;
|
||||
|
||||
Reference in New Issue
Block a user