up.status
JavaScript namespace
Features to show which request is loading and which link leads to the current page.
While a request is loading, the origin element that triggered it gets an .up-active class and the targeted fragments get .up-loading. For richer loading state, a link or form can show an [up-placeholder] inside the fragment it targets, or name an [up-preview] function registered with up.preview(). A preview can change the page in any way, up to rendering the expected result before the server confirms it. Every effect is reverted when the request ends.
Within an [up-nav] container, links pointing to the current location are marked .up-current, and the class moves as the user navigates.
Features
-
.up-active CSS
While rendering, the
.up-activeclass is added to the origin element that triggered the change. -
[up-alias] ATTR
Links within navigational containers may use the
[up-alias]attribute to define alternative URLs for which they should also be highlighted as.up-current. -
.up-current CSS
When a link within a navigational container points to the current location, it is assigned the
.up-currentclass. -
.up-loading CSS
While rendering, all targeted fragments are assigned the
.up-loadingclass. -
[up-nav] ATTR
Marks this element as a navigational container, such as a menu or navigation bar.
-
Links or forms can define a placeholder that will be shown within the targeted fragment while loading content from the server.
-
Registers a named preview function.
-
[up-preview] ATTR
Links or forms can name a preview function that is called while loading content from the server.
-
While revalidating content rendered from a stale cache entry, all targeted fragments are assigned the
.up-revalidatingclass. -
up.status.config CONFIG
Sets default options for status effects.