put public_folder config in parity with original ember version

This commit is contained in:
Cássio Zen 2016-08-30 11:18:14 -03:00
parent a1c01323e0
commit c7544cc0a2
2 changed files with 9 additions and 8 deletions

View File

@ -70,12 +70,13 @@ function parseConfig(data) {
} }
} }
if ('media_folder' in config && typeof config.media_folder === 'string') { if (!('public_folder' in config)) {
// Parse source & public paths for media folder. // Make sure there is a public folder
config.media_folder = { config.public_folder = config.media_folder;
path: config.media_folder, }
public_path: config.media_folder
}; if (config.public_folder.charAt(0) !== '/') {
config.public_folder = '/' + config.public_folder;
} }
return config; return config;

View File

@ -8,8 +8,8 @@ export default function MediaProxy(value, file, uploaded = false) {
this.file = file; this.file = file;
this.uploaded = uploaded; this.uploaded = uploaded;
this.sha = null; this.sha = null;
this.path = config.media_folder && !uploaded ? config.media_folder.path + '/' + value : value; this.path = config.media_folder && !uploaded ? config.media_folder + '/' + value : value;
this.public_path = config.media_folder && !uploaded ? config.media_folder.public_path + '/' + value : value; this.public_path = config.public_folder && !uploaded ? config.public_folder + '/' + value : value;
} }
MediaProxy.prototype.toString = function() { MediaProxy.prototype.toString = function() {