File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed
templates/repo/issue/view_content Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1- <div class="item action ui dropdown jump pointing top right context-dropdown">
1+ <fomantic-dropdown class="item action ui dropdown jump pointing top right context-dropdown">
22 <a class="context-menu muted">
33 {{svg "octicon-kebab-horizontal"}}
44 </a>
4141 {{end}}
4242 {{end}}
4343 </div>
44- </div >
44+ </fomantic-dropdown >
Original file line number Diff line number Diff line change 1+ /**
2+ * Dropdown web component.
3+ *
4+ * This component wraps a Fomantic UI dropdown, allowing you to apply the same
5+ * classes and attributes as you would with a standard Fomantic dropdown.
6+ *
7+ * It ensures automatic initialization when connected to the DOM, which is useful
8+ * for dynamically added elements, eliminating the need for manual initialization.
9+ */
10+ class FomanticDropdown extends HTMLElement {
11+ connectedCallback ( ) {
12+ if ( window . jQuery ) {
13+ window . $ ( this ) . dropdown ( ) ;
14+ }
15+ // note: if jquery is not defined then this component was part of the initial page load and
16+ // will be initialized by the fomantic-ui js
17+ }
18+ }
19+
20+ customElements . define ( 'fomantic-dropdown' , FomanticDropdown ) ;
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ import '@github/relative-time-element';
33import './origin-url.ts' ;
44import './overflow-menu.ts' ;
55import './absolute-date.ts' ;
6+ import './fomantic-dropdown.ts' ;
You can’t perform that action at this time.
0 commit comments