src/pyams_content/component/paragraph/zmi/__init__.py
changeset 283 9139536eab90
parent 242 2bbead234b84
child 354 871c7cb35fd6
--- a/src/pyams_content/component/paragraph/zmi/__init__.py	Sun Nov 26 09:50:28 2017 +0100
+++ b/src/pyams_content/component/paragraph/zmi/__init__.py	Sun Nov 26 09:51:48 2017 +0100
@@ -9,7 +9,6 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-from pyramid.location import lineage
 
 __docformat__ = 'restructuredtext'
 
@@ -39,6 +38,7 @@
 from pyams_utils.traversing import get_parent
 from pyams_viewlet.viewlet import viewlet_config
 from pyams_zmi.form import AdminDialogEditForm
+from pyramid.location import lineage
 from pyramid.view import view_config
 from z3c.form import field
 
@@ -118,10 +118,10 @@
         return {'status': 'success',
                 'message': self.request.localizer.translate(_("Paragraph was correctly added.")),
                 'events': [{
-                    'event': 'PyAMS_content.changed_item',
+                    'event': 'myams.refresh',
                     'options': {
                         'handler': 'PyAMS_content.paragraphs.refreshParagraphs',
-                        'object_name': paragraphs_table.id,
+                        'object_id': paragraphs_table.id,
                         'table': paragraphs_table.render()
                     }
                 }]}
@@ -150,10 +150,12 @@
         output = super(BaseParagraphAJAXEditForm, self).get_ajax_output(changes)
         if 'title' in changes.get(IBaseParagraph, ()):
             output.setdefault('events', []).append({
-                'event': 'PyAMS_content.changed_item',
-                'options': {'handler': 'PyAMS_content.paragraphs.refreshParagraph',
-                            'object_name': self.context.__name__,
-                            'title': II18n(self.context).query_attribute('title', request=self.request),
-                            'visible': self.context.visible}
+                'event': 'myams.refresh',
+                'options': {
+                    'handler': 'PyAMS_content.paragraphs.refreshParagraph',
+                    'object_name': self.context.__name__,
+                    'title': II18n(self.context).query_attribute('title', request=self.request),
+                    'visible': self.context.visible
+                }
             })
         return output