Closed akarelas closed 10 years ago
What does scrollTo
do? I click on RUN at that point in the docs, and nothing happens,
You'll notice that the scrollTo
example has the comment # Requires jQuery scrollTo plugin
. More about the scrollTo plugin is here: http://flesler.com/jquery/scrollTo/. It's true, though, that in the docs nothing happens, but I thought it could be helpful to link to the plugin if you hadn't found it already.
The url
parameter when calling .run
is meant to fetch data from a remote source. The docs say that you can use .run' and include jQuery's standard
$.ajaxoptions:
# All the standard jQuery ajax options here`. The options/settings are listed here: http://api.jquery.com/jQuery.ajax/.
From reading the code (and I could be wrong), .post
seems to just be a simple displaying of a message while .run
seems to more functionality, e.g. making an ajax call, etc. But .post
can be a confusing method name when POST
is also the name of an HTTP method: http://en.wikipedia.org/wiki/POST_%28HTTP%29.
Yep, we're working on real API docs, but in the meantime I can explain.
post
is the method used to 'post' a message. run
is added at a higher level, to run a command and use messages to show that methods progress, success and/or failure. The default action for run
is $.ajax
.
Other questions I have after reading the docs:
I'll take a crack at these:
- How can I make a message sticky?
- How can I configure a specific message to be sticky while others have a timeout?
hideAfter: false
- what about show/hide animations?
At the moment, I believe simple animations are easy to accomplish with CSS (so a theme could add animations). However, additional class names would need to be managed by javascript to allow for complex animation functionality.
- what types of messages available?
[Edit] I believe this is a complete list: error, success, info
.
I don't believe there is no warning
type, so it's just error
, success
and info
. You are free to use any additional types you would like, such as warning
, but they won't be styled by the default theme css.
@zackbloom I'd suggest keeping this open as a “Documentation Improvement” thread rather than closing it out. You're correct, there is no warning type only success, info, and error.
Hopefully there's no need any longer: http://github.hubspot.com/messenger
Those docs are haphazard. For people like me, who are only using it to show notifications not provide client-side actions it's OK but if I was trying to retry AJAX requests and the like it would be difficult to understand how that is implemented and what consequences go into say retrying an event after it looks like it failed.
We'll work on cleaning them up, but you are also free to PR into the docs directory.
@zackbloom Closed because more docs were added?
1) What is the meaning of the url parameter when calling .run? It says nowhere
2) What is the difference between .run and .post? It says nowhere