Interface Element.ElementJs

All Superinterfaces:
Serializable
Enclosing class:
Element

@JsDefinition public static interface Element.ElementJs extends Serializable
JavaScript that Flow runs on an element, as a JavaScript definition for Element.executeJs(Class).
Since:
25.4
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    flashClass(String className)
    Adds the CSS class to the element and removes it again when the animation it starts has ended.
    void
    Dispatches a window-resize event on the element whenever the browser window is resized, with the new browser window width and height (the viewport size, excluding scrollbars) as its w and h properties, so that a resize can be listened to on the element.
  • Method Details

    • flashClass

      @JsExpression("window.Vaadin.Flow.flashClass(this, $0)") void flashClass(String className)
      Adds the CSS class to the element and removes it again when the animation it starts has ended.
      Parameters:
      className - the CSS class name to flash
      See Also:
    • forwardWindowResize

      @JsExpression("const el = this;\nwindow.addEventListener(\'resize\', evt => {\n const event = new Event(\"window-resize\");\n event.w = document.documentElement.clientWidth;\n event.h = document.documentElement.clientHeight;\n el.dispatchEvent(event);\n});\n") void forwardWindowResize()
      Dispatches a window-resize event on the element whenever the browser window is resized, with the new browser window width and height (the viewport size, excluding scrollbars) as its w and h properties, so that a resize can be listened to on the element.