Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions/Requests about ConfirmModal and PromptModal (custom css and html) #76

Closed
Seb- opened this issue Sep 2, 2016 · 5 comments
Closed
Labels

Comments

@Seb-
Copy link

Seb- commented Sep 2, 2016

Is it possible to add a custom css class for ConfirmModal or PromptModal?

I tried to add a "class" parameters in the configuration object, but that didn't seem to work.

I would also like to be able to insert html into the buttons text to add an icon to them. How should I do that?

@soumak77
Copy link
Contributor

soumak77 commented Sep 2, 2016

Custom CSS can be added by using the provided .confirm-modal and .prompt-modal classes.

There is no way currently to customize the HTML structure of the modals. Since the modals use the ModalFactory, it would make sense to allow customizing the configuration object used by both modals. Some properties of the configuration object such as contentScope and destroyOnClose are vital to the functionality of the modals, but properties such as class, overlay, and templateUrl can be used to adjust the styling of the modals.

I would like to make the ConfirmModal and PromptModal as easy to configure as possible, but I also don't want to go down the route of adding configuration options for every single use case as at some point it'll get out of hand. For instance, I would like to add support for icons to the buttons, but 4 configuration options would be needed of the gate:

  1. Icon HTML for enter button
  2. Icon HTML for cancel button
  3. Icon position for enter button icon
    • available if using one of the icons supported by Angular Icons
  4. Icon position for cancel button icon
    • available if using one of the icons supported by Angular Icons

Adding icons to the modals could instead be done by creating a new template for the modals and overriding the default template provided by Angular Base Apps. This is probably the best approach to cover all use cases.

If you need anything more complex (like modifying contentScope), it likely points to needing to write your own implementation of the modals.

@soumak77
Copy link
Contributor

soumak77 commented Sep 2, 2016

@Seb- if you need support for this right away, you can inject the html into the buttons after the modal has been rendered. The enter and cancel buttons have the enter-button and cancel-button classes, respectively.

@soumak77
Copy link
Contributor

soumak77 commented Sep 3, 2016

@Seb- I've created a new issue to add support for overriding the templateUrl property. Is there anything else that needs to be addressed before this can be closed?

@soumak77
Copy link
Contributor

closing with the assumption this is resolved

@Seb-
Copy link
Author

Seb- commented Sep 13, 2016

I need to progress in my project and this seems to be too much for the result so I gave up on it for the moment and just kept default. The information was useful though. I might get back to it and comment more when I have time to play with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants