Sha256: 91f60a566a089d65467fd0fd1f157c7d6d90413a16e6a262e11789c615d891ad

Contents?: true

Size: 341 Bytes

Versions: 30

Compression:

Stored size: 341 Bytes

Contents

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
  static targets = [ "menu" ]

  show(event) {
    this.menuTarget.style.insetInlineStart = `${event.clientX - 5}px`
    this.menuTarget.style.insetBlockStart  = `${event.clientY - 5}px`
    setTimeout(() => this.menuTarget.showPopover(), 150)
  }
}

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
css-zero-1.1.9 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.8 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.7 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.6 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.5 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.4 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.3 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.2 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.1 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.1.0 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.0.6 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.0.5 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.0.4 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.0.3 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.0.2 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.0.1 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-1.0.0 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-0.0.98 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-0.0.97 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js
css-zero-0.0.96 lib/generators/css_zero/add/templates/app/javascript/controllers/context_menu_controller.js