From c2994c1ac7846f00356146eb8bcf085ea607e231 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 23 Apr 2021 15:13:43 +0200 Subject: [PATCH] MaterialComponents: modal test page --- SL/Controller/MaterializeTest.pm | 6 ++- menus/mobile/00-erp.yaml | 7 +++- templates/mobile_webpages/test/modal.html | 49 +++++++++++++++++++++++ 3 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 templates/mobile_webpages/test/modal.html 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") %] +
-- 2.20.1