mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
rename frontend to web and update contributing guide (#2509)
* rename frontend to web and update contributing guide * rename this time * fix build * restructure rust code * update documentation * update descriptions * Update CONTRIBUTING.md Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com> --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com>
This commit is contained in:
21
web/projects/shared/src/directives/enter/enter.directive.ts
Normal file
21
web/projects/shared/src/directives/enter/enter.directive.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Directive, HostListener, Inject } from '@angular/core'
|
||||
import { DOCUMENT } from '@angular/common'
|
||||
import { debounce } from '../../util/misc.util'
|
||||
|
||||
@Directive({
|
||||
selector: '[appEnter]',
|
||||
})
|
||||
export class EnterDirective {
|
||||
constructor(@Inject(DOCUMENT) private readonly document: Document) {}
|
||||
|
||||
@HostListener('document:keydown.enter')
|
||||
@debounce()
|
||||
handleKeyboardEvent() {
|
||||
const elems = this.document.querySelectorAll('.enter-click')
|
||||
const elem = elems[elems.length - 1] as HTMLButtonElement
|
||||
|
||||
if (elem && !elem.classList.contains('no-click') && !elem.disabled) {
|
||||
elem.click()
|
||||
}
|
||||
}
|
||||
}
|
||||
9
web/projects/shared/src/directives/enter/enter.module.ts
Normal file
9
web/projects/shared/src/directives/enter/enter.module.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NgModule } from '@angular/core'
|
||||
|
||||
import { EnterDirective } from './enter.directive'
|
||||
|
||||
@NgModule({
|
||||
declarations: [EnterDirective],
|
||||
exports: [EnterDirective],
|
||||
})
|
||||
export class EnterModule {}
|
||||
Reference in New Issue
Block a user