improved public path resolution
This commit is contained in:
@ -1,3 +1,5 @@
|
|||||||
|
import { resolvePath } from '../lib/pathHelper';
|
||||||
|
|
||||||
let config;
|
let config;
|
||||||
export const setConfig = (configObj) => {
|
export const setConfig = (configObj) => {
|
||||||
config = configObj;
|
config = configObj;
|
||||||
@ -8,8 +10,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 + '/' + value : value;
|
this.path = config.media_folder && !uploaded ? `${ config.media_folder }/${ value }` : value;
|
||||||
this.public_path = config.public_folder && !uploaded ? config.public_folder + '/' + value : value;
|
this.public_path = !uploaded ? resolvePath(value, config.public_folder) : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaProxy.prototype.toString = function () {
|
MediaProxy.prototype.toString = function () {
|
||||||
|
Reference in New Issue
Block a user