typograph-editor-documentation
    Preparing search index...

    Class Popupmenu_text

    Hierarchy (View Summary)

    Index
    • Parameters

      • type: string
      • id: string
      • width: number
      • items: { id: string; label: string }[]
      • current_id: string

      Returns Popupmenu_text

    _hidemenu: any = ...
    _selectmenu: any = ...
    active: boolean
    arrow: HTMLElement
    container: HTMLElement
    current_id: string
    dialog: Dialog = null
    element: HTMLElement
    id: string
    menucontoler: MenuControler
    menuitems: menuitemdata[]
    on_select: (id: string) => void = null
    popupmenuwidth: number = 200
    removeunderscore: boolean = true
    text_items: { id: string; label: string }[]
    title: string
    title_holder: HTMLElement
    translate: boolean = false

    Show the title and the items in the user's language (TYP-1287). Only for a menu of the editor's own choices — alignments, fit modes, blend modes. Never for one that lists a document's fonts, styles or swatches: those are names, not words to translate.

    type: string
    width: number
    • Parameters

      • cb: (id: string) => void

      Returns void

    • ⚠️ This must not be able to throw on its own argument.

      Titles come from a document — a font family, a style name, a swatch name — and any of them can be absent in a document that is merely unusual rather than broken. It used to call this.title.split() on whatever arrived, so one run whose font resolved to nothing threw here and the toolbar never finished building: clicking into a text frame took the editor down (TYP-739). A menu with nothing to show should show nothing.

      The parameter's type is widened to say what actually reaches it. The element lookup below is deliberately NOT guarded: a missing title element means this menu was built with the wrong id, which is a wiring mistake and should stay loud.

      Parameters

      • i: string
      • removeunderscore: boolean = true

      Returns void