trilium
    Preparing search index...

    Class NoteContextAwareWidget

    This widget allows for changing and updating depending on the active note.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _noteId: string
    _position: number
    $widget: JQuery<HTMLElement>
    attrs: Record<string, string>
    children: default[]
    componentId: string
    initialized: null | Promise<void>
    noteContext?: NoteContext
    parent?: TypedComponent<any>

    Accessors

    Methods

    • Indicates if the widget is enabled. Widgets are enabled by default. Generally setting this to false will cause the widget not to be displayed, however it will still be available on the DOM but hidden.

      If the widget is not enabled, it will not receive `refreshWithNote` updates.

      Returns undefined | null | boolean

      true when an active note exists

    • Sets the CSS attribute of the given name to the given value, but only if the condition provided is truthy.

      Parameters

      • condition: boolean

        true in order to apply the CSS, false to ignore it.

      • name: string

        the name of the CSS attribute to set (e.g. padding-left).

      • value: string

        the value of the CSS attribute to set (e.g. 12px).

      Returns NoteContextAwareWidget

      self for chaining.