From b1843c688c6f469346eabc82cad093e8b4370882 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Wed, 11 Sep 2019 17:34:11 -0600 Subject: [PATCH] Add basic modal component; Add resultDetails to search --- app/views/partials/modal.js | 66 +++++++++++++++++++++++++++++++ app/views/search/controller.js | 9 +++++ app/views/search/index.js | 37 ++++++++--------- app/views/search/resultDetails.js | 19 +++++++++ 4 files changed, 113 insertions(+), 18 deletions(-) create mode 100644 app/views/partials/modal.js create mode 100644 app/views/search/resultDetails.js diff --git a/app/views/partials/modal.js b/app/views/partials/modal.js new file mode 100644 index 0000000..77b3667 --- /dev/null +++ b/app/views/partials/modal.js @@ -0,0 +1,66 @@ +import html from 'choo/html'; + +export const modal = (modalId, controller, contentHTML, options = {}) => { + /* Options: + * controller : Pass the controller class with state; Requires get/set for openModal in state. + * buttonHTML : Displayed in place of the default button to open the modal + * buttonText : Displayed if no buttonHTML is specified + * noHeader : Set to `true` and exclude headerHTML to not include a modal header + * headerHTML : Displayed in place of the default header; Recommended to use `
` tag + * headerText : Displayed in an `

` if no header is specified + * noFooter : Set to `true` and exclude footerHTML to not include a modal footer + * footerHTML : Displayed in place of the default footer; Recommended to use `