LzHistory

Manages interaction with the browser history and back button.

NOTE: You must load your lzx with the lzt=history wrapper HTML to use LzHistory.

The LzHistory 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="lzSetCanvasAttribute('foo', 0)"/> 
    <input type="button" value="1" onclick="lzSetCanvasAttribute('foo', 1)"/> 
</form>

Methods

next()
LzHistory.next()

Step back one step in the history stack. Adds an item to the browser history stack.



prev()
LzHistory.prev()

Step forward one step in the history stack. Adds an item to the browser history stack.



save()
LzHistory.save(who, prop, 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).

Parameters
Name Type Desc
who None
prop None
val None