Wants-reset

From Frontal Wiki

Jump to: navigation, search

Contents

Purpose

This style determines if the element is resettable.


Value

Either "true" or "false." The default value is "false" except for the 'img', 'manager' and 'include' tags. It is also "true" for the scrollbar templates.

wnats-reset: false;


Remarks

Various container types and interactions will make a container "resettable." What this effectively means is that these containers then become reset-event listeners. Reset events are sent by 'manager' tags as well as the 'document' tag as discussed below.

First we must ask, what is a "reset" and why are we interested in it? The concept is that there is some initial state of an element that occasionally needs to be revisited. For example, a managed element is occasionally selected and when that happens, it may need to be reset. For example, a video tag will restart the video when it is reset. An img tag may send a symbol or SWF to a particular frame. A scrollable element will reset the scrollbars to their initial position.

So which tag in particular does an element with wants-reset set to "true" listen to for the reset event? There are two scenarios: either the container is managed or has an ancestor that is managed, or it is not. In the former case, the container will listen to itself or to its ancestor for the reset events. In the latter case, it will listen to the document.

There is a complication to this rule though and that is if an element has is-marker set to true. In that case, the element will get its reset event from whatever element it is marking. See that style for more details.

Listening to the document for a reset event is troublesome because of the need to get an initial reset. The problem is that if we've added a document segment to an already existent document, we only want to reset the newly added portion. To solve this, we have two reset signals: the initial reset and the plain reset.

When a resettable container is added to a document and isn't managed, we add a listener to the document for the initial reset event. When it gets this event the first time, we remove the listener. We also add a listener to the document for the plain reset event and this one persists. (This latter listener handles the case that the 'document' tag itself is later reset.)

Note that in this scenario, the only containers to ever get the initial reset event are containers that are not managed. This should not be a problem because we expect the manager (a resettable container) to dispatch a reset event whenever it is itself reset or when it is told to select a new child and the appropriate styles are set.

Also note that both the initial reset and the plain reset call the reset method on the container. The reset function cannot distinguish between the two calls though it may use the isInitialReset member variable to determine if this is the first reset call or not (not a necessarily equivalent to the initial reset which may occur after a manual call to reset for example).

See Adding Interactions#System Interactions for a discussion of interactions vis a vis the reset event.


Example

This page is incomplete


Can Be Applied To

This style can be applied to any element.

Personal tools
Get Adobe Flash player