Added support for IObjectData interface on menu items and actions
authorThierry Florac <thierry.florac@onf.fr>
Tue, 06 Feb 2018 14:54:45 +0100
changeset 271 a3e2deed9fad
parent 270 a67f68790124
child 272 e0503d0c624b
Added support for IObjectData interface on menu items and actions
src/pyams_skin/viewlet/toolbar/action.pt
src/pyams_skin/viewlet/toolbar/menu-item.pt
src/pyams_skin/viewlet/toolbar/toolbar-item.pt
--- a/src/pyams_skin/viewlet/toolbar/action.pt	Fri Feb 02 16:50:10 2018 +0100
+++ b/src/pyams_skin/viewlet/toolbar/action.pt	Tue Feb 06 14:54:45 2018 +0100
@@ -3,7 +3,8 @@
 	<div tal:attributes="class view.css_class;
 						 data-toggle 'modal' if view.modal_target else None;
 						 data-ams-url view.get_url();
-						 data-ams-stop-propagation 'true' if view.modal_target else None;">
+						 data-ams-stop-propagation 'true' if view.modal_target else None;
+						 data-ams-data extension:object_data(view);">
 		<i tal:attributes="class view.label_css_class"></i>&nbsp;
 		<tal:var content="view.label" />
 	</div>
--- a/src/pyams_skin/viewlet/toolbar/menu-item.pt	Fri Feb 02 16:50:10 2018 +0100
+++ b/src/pyams_skin/viewlet/toolbar/menu-item.pt	Tue Feb 06 14:54:45 2018 +0100
@@ -3,7 +3,8 @@
 					   data-ams-url view.get_url();
 					   data-ams-target view.target | nothing;
 					   data-ams-stop-propagation 'true' if view.stop_propagation else None;
-					   data-toggle 'modal' if view.modal_target else None;">
+					   data-toggle 'modal' if view.modal_target else None;
+					   data-ams-data extension:object_data(view);">
 		<i tal:attributes="class view.label_css_class"></i>&nbsp;
 		<tal:var content="view.label" />
 	</a>
--- a/src/pyams_skin/viewlet/toolbar/toolbar-item.pt	Fri Feb 02 16:50:10 2018 +0100
+++ b/src/pyams_skin/viewlet/toolbar/toolbar-item.pt	Tue Feb 06 14:54:45 2018 +0100
@@ -3,7 +3,8 @@
 				   data-ams-url view.get_url();
 				   data-ams-target view.target | nothing;
 				   data-ams-stop-propagation 'true' if view.stop_propagation else None;
-				   data-toggle 'modal' if view.modal_target else None;">
+				   data-toggle 'modal' if view.modal_target else None;
+				   data-ams-data extension:object_data(view);">
 	<i tal:attributes="class string:${view.label_css_class} hint opaque align-base;
 					   data-ams-hint-gravity view.hint_gravity;
 					   data-ams-hint-html 'true' if view.label.startswith('<') else 'false';