Popover menu: Refactor to remove the necessity of coupling JS and PHP code to instantiate it correctly

This commit is contained in:
Molkobain
2021-03-22 13:21:31 +01:00
parent e8656e8504
commit 65ed5b3fce
14 changed files with 409 additions and 137 deletions

View File

@@ -1,4 +1,10 @@
$('#{{ oUIBlock.GetId() }}').popover_menu({
toggler: {{ oUIBlock.GetTogglerJSSelector()|json_encode|raw }},
container: {{ oUIBlock.GetContainer()|json_encode|raw }},
position: {
target: {{ oUIBlock.GetTargetForPositionJSSelector()|json_encode|raw }},
vertical: {{ oUIBlock.GetVerticalPosition()|json_encode|raw }},
horizontal: {{ oUIBlock.GetHorizontalPosition()|json_encode|raw }},
},
add_visual_hint_to_toggler: {{ oUIBlock.HasVisualHintToAddToToggler()|var_export }}
});

View File

@@ -17,7 +17,9 @@
{% for FormActionButton in oUIBlock.GetMainActionButtons() %}
{{ render_block(FormActionButton, {aPage: aPage}) }}
{% endfor %}
{{ render_block(oUIBlock.GetSendButtonPopoverMenu(), {aPage: aPage}) }}
{% if oUIBlock.HasSendButtonPopoverMenu() %}
{{ render_block(oUIBlock.GetSendButtonPopoverMenu(), {aPage: aPage}) }}
{% endif %}
</div>
</div>
<div class="ibo-caselog-entry-form--text-input" data-role="ibo-caselog-entry-form--text-input">