DEV: Convert connector file to use glimmer component (#59)

Why this change?

We've established internally that this is the better way to do things
This commit is contained in:
Alan Guo Xiang Tan 2023-10-04 16:02:30 +08:00 committed by GitHub
parent e452c049ae
commit 4ae24c6edc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 11 deletions

View File

@ -1,5 +1,5 @@
{{d-button
<DButton
class="btn-primary"
action=(action "showTOCOverlay")
label=(theme-prefix "table_of_contents")
}}
@action={{this.showTOCOverlay}}
@label={{theme-prefix "table_of_contents"}}
/>

View File

@ -1,7 +1,9 @@
export default {
actions: {
showTOCOverlay() {
document.querySelector(".d-toc-wrapper").classList.toggle("overlay");
},
},
};
import Component from "@glimmer/component";
import { action } from "@ember/object";
export default class DTocMini extends Component {
@action
showTOCOverlay() {
document.querySelector(".d-toc-wrapper").classList.toggle("overlay");
}
}