Webanizr Logo
Open / sluit menu
module crumbPath

Last change: August 10, 2020

Current version: 1.1.1

The module codeMirror loads a Code Mirror editor on your website.

syntax

webanizr.collect('crumbPath', parameters, callback);

webanizr.send('crumbPath', data, parameters, callback);

collect - parameters

The collect function initializes a crumbpath. It does not display anything untill a send is performed.

id__crumbpath (required)

The unique id for this crumbpath. Only use letters and / or numbers

id__dom (optional)

The id of the DOM element in which to display the state of the crumbpath

label__separator (optional)

The label to use as separator. If not set, the label " / " is used. The string can containt HTML.

label__back (optional)

The label to use for the back / close button. If not set, the label " x " is used. The string can contain HTML. If this option contains an empty string, the back button is not shown.

class__labels (optional)

The class to apply to each step label. If this property is set, the labels of the steps will wrapped in a span with this class.

labels__poststeps (optional)

Contains the labels of all the steps. If these steps are not added yet, the corresponding label from this list will be shown.

collect - callback

The callback is called after the crumbpath is initialized. In this callback you can perform the first send.

send - data

The data contains the information about the step to add

label__step (optional)

The label to display in the crumbpath If not set the label "level ..." is used where ... is the number of the step in the cumbpath.

forward__functions (optional with the params.type__step="custom")

The callback function to perform when adding this step. The step is only added if this callback returns true

back__functions (optional with the params.type__step="custom")

The callback function that is performed when this step is closed. It should contain the instructions to restore the previous step. If this function does not return true, the label is not removed but the close button is.

id__list (required with the params.type__step="rec_list")

The DOM id of the recursive list to manipulate.

dataname__parent (required with the params.type__step="rec_list")

The dataname of the property that refers to the parent element.

id__parent (required with the params.type__step="rec_list")

The id of the parent element.

send - parameters

The send function adds or removes steps to the crumbpath.

id__crumbpath (required)

The unique id for this crumbpath. This must be an id used in a previous collect.

type__action (optional)

Determines if the crumbpath will add or remove a step from the crumbpath. If not set, "add" is assumed.

type__step (optional)

The type of step to add (only applicable in combination with the type__action="add"). The options are:

  • custom (default): expects callback functions with instructions to perfom when going forward and back
  • rec_list: adds a step which goes one level deeper into a recursive list

collect - callback

The callback is called after the crumbpath is initialized. In this callback you can perform the first send.

Changelog

  • August 10, 2020, 1.1.1 - rec_list mode also keeps the parent id in a webanizr var
  • August 9, 2020, 1.1.0 - Added labels__poststeps
  • August 8, 2020, 1.0.0 - Initial version