Sha256: 4e367c4c6f6c0552c32224e84bc89cff9e2c05dbc84e8f3eab867254886480ff

Contents?: true

Size: 1.53 KB

Versions: 3

Compression:

Stored size: 1.53 KB

Contents

"use strict";
// import {Controller} from '@hotwired/stimulus'
// export default class CommentComponent extends Controller {
//   static targets = ['tab', 'tabBarComponent']
//   declare readonly commentComponentTarget: HTMLDivElement
//   declare readonly tabBarComponentTarget: HTMLElement // technically a `nav but typescript can't find it?
//   declare readonly tabTargets: [HTMLButtonElement]
//   // keep in sync with comment_component.rb
//   SELECTED_TAB_CLASSES = ['ariadne-border-indigo-500', 'ariadne-text-indigo-600']
//   PUBLIC_BACKGROUND_COLOR = 'ariadne-bg-white'
//   INTERNAL_BACKGROUND_COLOR = 'ariadne-bg-internal-message'
//   toggleTab() {
//     for (const tab of this.tabTargets) {
//       if (tab.hasAttribute('aria-selected')) {
//         tab.classList.remove(...this.SELECTED_TAB_CLASSES)
//         this.toggleBackgrounds(tab, false)
//         tab.removeAttribute('aria-selected')
//       } else {
//         tab.setAttribute('aria-selected', 'true')
//         tab.classList.add(...this.SELECTED_TAB_CLASSES)
//         this.toggleBackgrounds(tab, true)
//       }
//     }
//   }
//   toggleBackgrounds(tab: HTMLButtonElement, publicComment: boolean) {
//     if (publicComment) {
//       this.tabBarComponentTarget.classList.add(this.PUBLIC_BACKGROUND_COLOR)
//       this.tabBarComponentTarget.classList.remove(this.INTERNAL_BACKGROUND_COLOR)
//       this.tabBarComponentTarget.classList.remove(this.PUBLIC_BACKGROUND_COLOR)
//       this.tabBarComponentTarget.classList.add(this.INTERNAL_BACKGROUND_COLOR)
//     }
//   }
// }

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.17 app/components/ariadne/comment-component.js
ariadne_view_components-0.0.16 app/components/ariadne/comment-component.js
ariadne_view_components-0.0.15 app/components/ariadne/comment-component.js