Allow title to be changed in IMatchModals

Started by monochrome, February 09, 2018, 10:54:40 AM

Previous topic - Next topic

monochrome

The current template for IMatchModals dialog boxes has a fixed title - "IMatch". It would be much more space-efficient and clear to the user if the dialog box could be parameterized by "title" as well. According to "Error Message Guidelines" - https://msdn.microsoft.com/en-us/library/windows/desktop/ms679325(v=vs.85).aspx :

Quote from: MSDN Error Message Guidelines
Display only the product, component, or wizard name in the title bar of the message. This helps the user determine where the problem is. Do not summarize the problem in the title bar or include the word "error".

Having "IMatch" as the title, while correct, indicates that the error comes from IMatch itself, and not the embedded app.

Mario

It takes only a few lines of HTML to make your own template and load it. Would that not be the better solution?
All IMatch dialog boxes have the title "IMatch" so the user can tell.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

monochrome

Sure. But I thought the whole point of having IMatchModals is so that each app doesn't have to reinvent the wheel.

Mario

I've included IMatchModals to make it easier to work with modal dialogs in IMatch apps, and to make it easy to create your own templates.

You can change the title of the modal (in the callback) easily like so:

$('#modal-title') = 'Oops!';
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

monochrome

How would that work? Before the modal is opened, the element doesn't exist, and the callback parameter is called when the modal closes.

Mario

#5
I mean the callback of showModal(). Not from one of the pre-made modals I include as samples. See the modal documentation and the included source code for details.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

IMatch 2018 contains some enhancements for the IMatchModals class. It now supports Bootstrap 4 (with implicit switch to FontAwesome 5) and you can now also change the title of the standard modals from 'IMatch' to whatever you want.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook