Sha256: 40e0f31a965aa458e53720243cccf6319446ab5326aacdebcfc966be4f2ffb44

Contents?: true

Size: 421 Bytes

Versions: 5

Compression:

Stored size: 421 Bytes

Contents

import { Controller } from "@hotwired/stimulus";

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

  enable() {
    this.enableTarget.disabled = false;
  }

  disable() {
    this.enableTarget.disabled = true;
  }

  change(event) {
    if (event.type.match(/rmp:select:.*/)) {
      if (event.detail.count > 0) {
        this.enable();
      } else {
        this.disable();
      }
    }
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails_mini_profiler-0.7.3 app/javascript/js/enable_controller.js
rails_mini_profiler-0.7.2 app/javascript/js/enable_controller.js
rails_mini_profiler-0.7.1 app/javascript/js/enable_controller.js
rails_mini_profiler-0.7.0 app/javascript/js/enable_controller.js
rails_mini_profiler-0.6.0 app/javascript/js/enable_controller.js