From: Sven Schöling Date: Fri, 23 Apr 2021 13:13:43 +0000 (+0200) Subject: MaterialComponents: modal test page X-Git-Tag: kivitendo-mebil_0.1-0~9^2~84 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c2994c1ac7846f00356146eb8bcf085ea607e231;p=kivitendo-erp.git MaterialComponents: modal test page --- diff --git a/SL/Controller/MaterializeTest.pm b/SL/Controller/MaterializeTest.pm index de7918202..cbf25d5bf 100644 --- a/SL/Controller/MaterializeTest.pm +++ b/SL/Controller/MaterializeTest.pm @@ -3,8 +3,12 @@ package SL::Controller::MaterializeTest; use strict; use parent qw(SL::Controller::Base); -sub action_test { +sub action_components { $_[0]->render("test/components"); } +sub action_modal { + $_[0]->render("test/modal"); +} + 1; diff --git a/menus/mobile/00-erp.yaml b/menus/mobile/00-erp.yaml index 62231c8ce..a5e30b19b 100644 --- a/menus/mobile/00-erp.yaml +++ b/menus/mobile/00-erp.yaml @@ -14,4 +14,9 @@ name: Component Test order: 200 params: - action: MaterializeTest/test + action: MaterializeTest/components +- id: modal_test + name: Modal Test + order: 300 + params: + action: MaterializeTest/modal diff --git a/templates/mobile_webpages/test/modal.html b/templates/mobile_webpages/test/modal.html new file mode 100644 index 000000000..2d4022940 --- /dev/null +++ b/templates/mobile_webpages/test/modal.html @@ -0,0 +1,49 @@ +[% USE P %] + +

Material Modal Tests

+ + +
+ +Button triggered modal, no close/agree button:
+ +[% P.M.button_tag("", "Modal", class="modal-trigger", href="#modal1") %] + + + +
+ + +
+Button triggered modal, close/agree button:
+ +[% P.M.button_tag("", "Modal", class="modal-trigger", href="#modal2") %] + + + +
+ +
+Javascript triggered modal:
+[% P.M.button_tag("\$('#modal1').modal('open')", "Open!") %] +
+ + +
+popup_dialog modal with given html:
+[% P.M.button_tag("kivi.popup_dialog({ html: 'Testtext'})", "Testtext") %] +