dev_forum
hjm 5 years ago
parent 83dde48a8a
commit f300f2642e

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { getUrl2 } from 'educoder' import { getUrl2, isDev } from 'educoder'
const $ = window.$ const $ = window.$
let _url_origin = getUrl2() let _url_origin = getUrl2()
@ -81,18 +81,19 @@ class Cropper extends Component {
$.ajaxSetup({ $.ajaxSetup({
cache: true cache: true
}); });
const isDev = isDev()
let _path = isDev ? 'public' : 'build'
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/react/public/js/cropper/cropper.min.css`)); .attr('href', `${_url_origin}/react/${_path}/js/cropper/cropper.min.css`));
$.getScript( $.getScript(
`${_url_origin}/react/public/js/cropper/cropper.js`, `${_url_origin}/react/${_path}/js/cropper/cropper.js`,
(data, textStatus, jqxhr) => { (data, textStatus, jqxhr) => {
}); });
$.getScript( $.getScript(
`${_url_origin}/react/public/js/cropper/html2canvas.min.js`, `${_url_origin}/react/${_path}/js/cropper/html2canvas.min.js`,
(data, textStatus, jqxhr) => { (data, textStatus, jqxhr) => {
}); });

Loading…
Cancel
Save