@fermuch/monoflow-formio-components
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -14,2 +14,13 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
/** | ||
@@ -121,9 +132,10 @@ * This file shows how to create a custom component. | ||
}); | ||
document.addEventListener('monoflow-photo', this.onPhotoEvent.bind(this)); | ||
this.addEventListener(document, 'monoflow-photo', this.onPhotoEvent.bind(this)); | ||
return _super.prototype.attach.call(this, element); | ||
}; | ||
Photo.prototype.onPhotoEvent = function (ev) { | ||
if (ev && ev.detail && ev.detail.id === this.id) { | ||
var payload = ev.detail; | ||
var payload = __assign({}, ev.detail || {}); | ||
if (payload.id === this.id) { | ||
this.setValue(payload, {}); | ||
this.redraw(); | ||
} | ||
@@ -140,3 +152,2 @@ }; | ||
Photo.prototype.detach = function () { | ||
document.removeEventListener('monoflow-photo', this.onPhotoEvent.bind(this)); | ||
return _super.prototype.detach.call(this); | ||
@@ -143,0 +154,0 @@ }; |
{ | ||
"name": "@fermuch/monoflow-formio-components", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Monoflow components for Form.io", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
3360818
15546