Use "div" tags instead of "button" for menus and actions to prevent "Enter" key from activating them
authorThierry Florac <thierry.florac@onf.fr>
Wed, 11 Oct 2017 13:41:23 +0200
changeset 225 bc516135260f
parent 224 f5bec73fe71b
child 226 3305e0236e20
Use "div" tags instead of "button" for menus and actions to prevent "Enter" key from activating them
src/pyams_skin/viewlet/toolbar/action.pt
src/pyams_skin/viewlet/toolbar/menu.pt
--- a/src/pyams_skin/viewlet/toolbar/action.pt	Wed Oct 11 13:20:00 2017 +0200
+++ b/src/pyams_skin/viewlet/toolbar/action.pt	Wed Oct 11 13:41:23 2017 +0200
@@ -1,8 +1,9 @@
-<div class="btn-group">
-	<button tal:attributes="class view.css_class;
-							data-toggle 'modal' if view.modal_target else None;
-							data-ams-url view.get_url()">
+<div class="btn-group"
+	 tal:attributes="class view.group_css_class | default">
+	<div tal:attributes="class view.css_class;
+						 data-toggle 'modal' if view.modal_target else None;
+						 data-ams-url view.get_url()">
 		<i tal:attributes="class view.label_css_class"></i>&nbsp;
 		<tal:var content="view.label" />
-	</button>
+	</div>
 </div>
--- a/src/pyams_skin/viewlet/toolbar/menu.pt	Wed Oct 11 13:20:00 2017 +0200
+++ b/src/pyams_skin/viewlet/toolbar/menu.pt	Wed Oct 11 13:41:23 2017 +0200
@@ -1,10 +1,10 @@
 <div class="btn-group margin-right-2" tal:condition="view.viewlets">
-	<button tal:attributes="class view.css_class"
-			data-toggle="dropdown">
+	<div tal:attributes="class view.css_class"
+		 data-toggle="dropdown">
 		<i tal:attributes="class view.label_css_class"></i>&nbsp;
 		<tal:var content="view.label" />&nbsp;
 		<i class="fa fa-fw fa-caret-down"></i>
-	</button>
+	</div>
 	<ul tal:attributes="class view.menu_css_class">
 		<tal:loop repeat="viewlet view.viewlets"
 				  content="structure viewlet.render()" />