1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| export default optionsFromStrings;
|
| // Convert string to integers/booleans where it should be
| function optionsFromStrings(options){
| var intOptions = [
| "width",
| "height",
| "textMargin",
| "fontSize",
| "margin",
| "marginTop",
| "marginBottom",
| "marginLeft",
| "marginRight"
| ];
|
| for(var intOption in intOptions){
| if(intOptions.hasOwnProperty(intOption)){
| intOption = intOptions[intOption];
| if(typeof options[intOption] === "string"){
| options[intOption] = parseInt(options[intOption], 10);
| }
| }
| }
|
| if(typeof options["displayValue"] === "string"){
| options["displayValue"] = (options["displayValue"] != "false");
| }
|
| return options;
| }
|
|