# HG changeset patch # User Thierry Florac # Date 1537446830 -7200 # Node ID 5409ce8b714af4498eac8d38a7dd83e948d648b1 # Parent f2cf11a82a79fbcd7a68d5c1ae624f3390ede758 Added event to refresh thumbnail after new selection diff -r f2cf11a82a79 -r 5409ce8b714a src/pyams_media/zmi/video.py --- a/src/pyams_media/zmi/video.py Thu Sep 20 13:47:23 2018 +0200 +++ b/src/pyams_media/zmi/video.py Thu Sep 20 14:33:50 2018 +0200 @@ -26,6 +26,7 @@ from pyams_form.schema import CloseButton from pyams_media import _ from pyams_pagelet.pagelet import pagelet_config +from pyams_skin.event import get_json_image_refresh_event from pyams_skin.interfaces.viewlet import IContextActions from pyams_skin.layer import IPyAMSLayer from pyams_skin.viewlet.toolbar import ToolbarActionItem @@ -141,9 +142,14 @@ def get_ajax_output(self, changes): translate = self.request.localizer.translate if changes: + thumbnails = IThumbnails(self.context) + thumbnail = thumbnails.get_thumbnail('128x128') return { 'status': 'success', - 'message': translate(_("Thumbnail selected successfully.")) + 'message': translate(_("Thumbnail selected successfully.")), + 'events': [ + get_json_image_refresh_event(thumbnail, self.request) + ] } else: return {