rubycentral/cfp-app

View on GitHub
app/javascript/controllers/toggle_visibility_controller.js

Summary

Maintainability
A
0 mins
Test Coverage
import { Controller } from "stimulus";

export default class extends Controller {
  static targets = [ 'hidden' ]

  hidden() {
    return this.hiddenTarget
  }

  toggleHidden() {
    if (this.hidden().classList.contains('hidden')) {
      this.hidden().classList.remove('hidden');
    } else {
      this.hidden().classList.add('hidden');
    }
  }
}