Allow for customization of the loading message div and provide a general purpose $.mobile.showMessage() function#1947
Allow for customization of the loading message div and provide a general purpose $.mobile.showMessage() function#1947dgeb wants to merge 2 commits intojquery-archive:masterfrom
Conversation
…g message div instead of, or in addition to, the default of "ui-body-a". Also, allow $.mobile.loadingMessage to be set to true, instead of a string, so that a spinner may appear with no associated loading message.
…essage() function which can be used to display any message to the user. In addition to specifying a custom message, options such as delayTime, fadeTime, and wrapperClass can be specified. NOTE: the delayTime remains 800ms for page loading error messages for the sake of continuity, but the default delayTime has been increased to 2500ms, which seems more appropriate for messages of any length.
|
The team likes the idea of adding this but we might approach it differently. Thanks for your contribution. |
|
I probably shouldn't have combined both commits into a single pull request. However, I'd like to make sure that the second commit doesn't get lost, and it doesn't seem to be covered in #2044 It seems to me that there is little downside to extracting the error message logic into a new, reusable showMessage() function. Would you recommend that I extract that into a separate issue, create a new pull request with just that commit, or otherwise? Thanks for the consideration. |
|
We definitely want to create a new plugin for message style overlays so that is planned but we just want to give the API a bit of thought so we're going for the smallest tweak we can right now to make this a bit better. Feel free to add a note to the issue about adding the theme swatch - that's what you're referring to, right? |
|
I'm actually referring to this commit: dgeb@a6de24b This commit extracts the currently private code used to create an error message into a general purpose $.mobile.showMessage() function that is part of the API. This function takes an options object, which allows for theming as well as customization of message fade and delay times. Here's a use case: I've tried to provide sensible defaults so that options aren't normally needed. To take this further, I think that |
|
That's exactly what we're thinking. Create a message overlay plugin that the loader can then use. Can you create a new issue to track this and start sketching out ideas for how to structure this and we can track the conversation there. There is already a pretty robust dialog plugin here, but I think we'd probably make this simpler and more markup-focused for jQM so it's essentially a wrapper and you can drop whatever markup you want inside. |
|
Sounds good Todd. I just created a new issue: #2045 |
In the first commit, I allow for a customizable class (or classes) to be defined for the loading message div instead of, or in addition to, the default of "ui-body-a". Also, $.mobile.loadingMessage can now be set to true, instead of a string, so that a spinner may appear with no associated loading message.
In the second commit, I've extracted the error message logic into a new, reusable $.mobile.showMessage() function which can be used to display any message to the user. In addition to a custom message, options such as delayTime, fadeTime, and wrapperClass can be specified.
For a demo of these customizations in action, please see http://ioumate.com