aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-05-17 02:04:40 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-05-17 02:04:40 +0200
commit7cb8eac8e47f631eec6653e5439bcfb08d923224 (patch)
treeb6d08e4794fce3476baab9243b6629a559843029
parentHopefully fix remaining &amp; problems. (diff)
downloadcalp-7cb8eac8e47f631eec6653e5439bcfb08d923224.tar.gz
calp-7cb8eac8e47f631eec6653e5439bcfb08d923224.tar.xz
JS Fix adding of missing vcal properties.v0.6.3-rc1
-rw-r--r--static/vcal.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/static/vcal.js b/static/vcal.js
index f86d53de..93cfc028 100644
--- a/static/vcal.js
+++ b/static/vcal.js
@@ -278,7 +278,23 @@ class VComponent {
},
set: function (value) {
console.log("set", property_name, value);
- this._values[property_name].value = value;
+ /* Semi dirty hack to add properties which are missing.
+ Since we initialize without a type just guess depending
+ on the field name */
+ if (! this._values[property_name]) {
+ let type_arr
+ = valid_input_types[property_name.toUpperCase()]
+ || ['unknown'];
+ let type = type_arr[0];
+ /* Types which can take arrays are interesting */
+ if (type instanceof Array) {
+ type = type[0];
+ }
+ this._values[property_name]
+ = new VCalParameter(type, value)
+ } else {
+ this._values[property_name].value = value;
+ }
console.log(this._slots[property_name].length,
this._slots[property_name]);
/* TODO validate type */