View Source Pyro.Component.Helpers (Pyro v0.1.1)

A library of helpers for using/authoring Pyro components.

Link to this section Summary

Functions

A JS function to toggle CSS classes, since Phoenix does not yet provide one out of the box.

Translates the errors for a field from a keyword list of errors.

Link to this section Functions

Link to this function

toggle_class(js \\ %JS{}, classes, opts)

View Source
@spec toggle_class(js :: map(), classes :: String.t(), opts :: keyword()) :: map()

A JS function to toggle CSS classes, since Phoenix does not yet provide one out of the box.

examples

Examples

toggle_class("rotate-180 bg-green", to: "#icon")
Link to this function

translate_errors(errors, field)

View Source

Translates the errors for a field from a keyword list of errors.