Skip to content

Commit a5930a7

Browse files
Merge branch 'master' of https://github.com/surveyjs/widgets
2 parents 04d86c1 + 8f9efce commit a5930a7

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "surveyjs-widgets",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"scripts": {
55
"start": "npm run build && live-server",
66
"prebuild": "webpack --env.buildType dev",

src/image-picker.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,16 @@ function init(Survey, $) {
1414
activatedByChanged: function(activatedBy) {
1515
Survey.JsonObject.metaData.addClass(
1616
"imageitemvalues",
17-
[{ name: "imageLink" }],
17+
[],
1818
null,
1919
"itemvalue"
2020
);
21+
Survey.JsonObject.metaData.addProperty("imagepicker", {
22+
name: "imageLink"
23+
});
2124
Survey.JsonObject.metaData.addClass(
2225
"imagepicker",
2326
[
24-
{
25-
name: "choices:imageitemvalues",
26-
onGetValue: function(obj) {
27-
return Survey.ItemValue.getData(obj.choices);
28-
},
29-
onSetValue: function(obj, value) {
30-
obj.choices = value;
31-
}
32-
},
33-
{ name: "showLabel:boolean", default: false },
3427
{ name: "hasOther", visible: false },
3528
{ name: "otherText", visible: false },
3629
{ name: "optionsCaption", visible: false },
@@ -41,6 +34,19 @@ function init(Survey, $) {
4134
null,
4235
"dropdown"
4336
);
37+
Survey.JsonObject.metaData.addProperty("imagepicker", {
38+
name: "showLabel:boolean",
39+
default: false
40+
});
41+
Survey.JsonObject.metaData.addProperty("imagepicker", {
42+
name: "choices:imageitemvalues",
43+
onGetValue: function(obj) {
44+
return Survey.ItemValue.getData(obj.choices);
45+
},
46+
onSetValue: function(obj, value) {
47+
obj.choices = value;
48+
}
49+
});
4450
},
4551
afterRender: function(question, el) {
4652
var $el = $(el).is("select") ? $(el) : $(el).find("select");

src/signature_pad.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ function init(Survey) {
6363
canvas.width = question.width;
6464
canvas.height = question.height;
6565
resizeCanvas(canvas);
66-
signaturePad.fromDataURL(question.value);
66+
signaturePad.fromDataURL(
67+
question.value || "data:image/gif;base64,R0lGODlhAQABAIAAAP"
68+
);
6769
};
6870
question.valueChangedCallback = updateValueHandler;
6971
updateValueHandler();

0 commit comments

Comments
 (0)