--- a/src/pyams_skin/event.py Thu Sep 20 14:33:21 2018 +0200
+++ b/src/pyams_skin/event.py Thu Sep 20 15:02:44 2018 +0200
@@ -30,16 +30,17 @@
}
-def get_json_image_refresh_event(image, request):
+def get_json_image_refresh_event(image, request, source=None):
"""Get JSON response for image refresh event"""
dc = IZopeDublinCore(image)
- source = absolute_url(image, request)
+ src = absolute_url(image if source is None else source, request)
+ target = absolute_url(image, request)
return {
'event': 'myams.refresh',
'options': {
'handler': 'MyAMS.skin.refreshImage',
- 'src': source,
- 'target': '{0}?_={1}'.format(source, dc.modified.timestamp())
+ 'src': src,
+ 'target': '{0}?_={1}'.format(target, dc.modified.timestamp())
}
}