lz.HistoryService
Manages interaction with the browser history and back button.
JavaScript: lz.HistoryService
lz.History
is the single instance of the class
lz.HistoryService
.
The lz.History service manages interaction with the browser history and back button. Save state as often as you like, and
advance the
history when a new 'page' of values is required.
<form>
<input type="button" value="0" onclick="lz.embed.setCanvasAttribute('foo', 0)"/>
<input type="button" value="1" onclick="lz.embed.setCanvasAttribute('foo', 1)"/>
</form>
Methods
-
-
lz.HistoryService.clear();
Clears out the history state.
-
-
lz.HistoryService.next();
Moves forward one step in the history stack. Adds an item to the browser history.
-
-
lz.HistoryService.prev();
Moves back one step in the history stack. Adds an item to the browser history
-
-
lz.HistoryService.save(who : String, prop : String, val : *);
Saves a value and attribute name callback in the current offset of the
history stack. When the browser back button causes the history offset
to change, the attribute will get set to the value saved at that offset,
e.g. scope.setAttribute('attribute_name_to_set', value).
-
-
lz.HistoryService.setPersist(p : Boolean);
Turns history persistence across app reloads on or off