@fonixtree/magic-design 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/common/ImagePicker/index.js +6 -0
- package/es/meta-comp/config-panels/PlayIconConfig/index.less +4 -0
- package/es/utils/commonUtil.js +3 -2
- package/lib/common/ImagePicker/index.js +6 -0
- package/lib/meta-comp/config-panels/PlayIconConfig/index.less +4 -0
- package/lib/utils/commonUtil.js +3 -2
- package/package.json +1 -1
|
@@ -201,6 +201,12 @@ function (_super) {
|
|
|
201
201
|
return _this;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
ImagePicker.prototype.componentDidMount = function () {
|
|
205
|
+
this.setState({
|
|
206
|
+
inputVal: this.props.value
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
|
|
204
210
|
ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
|
|
205
211
|
if (nextProps.value != this.props.value) {
|
|
206
212
|
this.setState({
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -459,7 +459,7 @@ var getColorRgba = function getColorRgba(sHex, alpha) {
|
|
|
459
459
|
exports.getColorRgba = getColorRgba;
|
|
460
460
|
|
|
461
461
|
function asyncDataURLtoImage(dataUrl) {
|
|
462
|
-
return new Promise(function (resolve
|
|
462
|
+
return new Promise(function (resolve) {
|
|
463
463
|
var img = new Image();
|
|
464
464
|
|
|
465
465
|
img.onload = function () {
|
|
@@ -467,7 +467,8 @@ function asyncDataURLtoImage(dataUrl) {
|
|
|
467
467
|
};
|
|
468
468
|
|
|
469
469
|
img.onerror = function () {
|
|
470
|
-
|
|
470
|
+
console.error(dataUrl + ' img error');
|
|
471
|
+
resolve({});
|
|
471
472
|
};
|
|
472
473
|
|
|
473
474
|
img.src = dataUrl;
|
|
@@ -201,6 +201,12 @@ function (_super) {
|
|
|
201
201
|
return _this;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
ImagePicker.prototype.componentDidMount = function () {
|
|
205
|
+
this.setState({
|
|
206
|
+
inputVal: this.props.value
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
|
|
204
210
|
ImagePicker.prototype.componentWillReceiveProps = function (nextProps) {
|
|
205
211
|
if (nextProps.value != this.props.value) {
|
|
206
212
|
this.setState({
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -459,7 +459,7 @@ var getColorRgba = function getColorRgba(sHex, alpha) {
|
|
|
459
459
|
exports.getColorRgba = getColorRgba;
|
|
460
460
|
|
|
461
461
|
function asyncDataURLtoImage(dataUrl) {
|
|
462
|
-
return new Promise(function (resolve
|
|
462
|
+
return new Promise(function (resolve) {
|
|
463
463
|
var img = new Image();
|
|
464
464
|
|
|
465
465
|
img.onload = function () {
|
|
@@ -467,7 +467,8 @@ function asyncDataURLtoImage(dataUrl) {
|
|
|
467
467
|
};
|
|
468
468
|
|
|
469
469
|
img.onerror = function () {
|
|
470
|
-
|
|
470
|
+
console.error(dataUrl + ' img error');
|
|
471
|
+
resolve({});
|
|
471
472
|
};
|
|
472
473
|
|
|
473
474
|
img.src = dataUrl;
|