Updated viewlets
authorThierry Florac <thierry.florac@onf.fr>
Wed, 23 May 2018 15:16:25 +0200
changeset 322 fde93ea7a59a
parent 321 87fe0eaced17
child 323 391f772a2e6d
Updated viewlets
src/pyams_skin/viewlet/toolbar/__init__.py
--- a/src/pyams_skin/viewlet/toolbar/__init__.py	Wed May 23 15:13:18 2018 +0200
+++ b/src/pyams_skin/viewlet/toolbar/__init__.py	Wed May 23 15:16:25 2018 +0200
@@ -59,7 +59,8 @@
     modal_target = FieldProperty(IToolbarAction['modal_target'])
 
     def get_url(self):
-        return absolute_url(self.context, self.request, self.url)
+        context = getattr(self.__parent__, 'actions_context', self.context)
+        return absolute_url(context, self.request, self.url)
 
 
 class JsToolbarAction(ToolbarAction):
@@ -133,7 +134,8 @@
     stop_propagation = FieldProperty(IToolbarMenuItem['stop_propagation'])
 
     def get_url(self):
-        return absolute_url(self.context, self.request, self.url)
+        context = getattr(self.__parent__, 'actions_context', self.context)
+        return absolute_url(context, self.request, self.url)
 
 
 class JsToolbarActionItem(ToolbarActionItem):