Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sb_karaoke_cocos
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
sb_karaoke_cocos
Commits
02edcc25
Commit
02edcc25
authored
Feb 25, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: autofocus
parent
04e6ad70
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
472 additions
and
39 deletions
+472
-39
lrc-editor.component.html
form/src/app/common/lrc-editor/lrc-editor.component.html
+1
-1
lrc-editor.component.ts
form/src/app/common/lrc-editor/lrc-editor.component.ts
+6
-7
yarn.lock
form/yarn.lock
+465
-31
No files found.
form/src/app/common/lrc-editor/lrc-editor.component.html
View file @
02edcc25
...
...
@@ -102,7 +102,7 @@
</nz-spin>
</div>
<div
class=
"wave-player"
[
ngStyle
]="{
visibility:
LRCData
.
audio_url
?
'
visible
'
:
'
hidden
'}"
>
<canvas
#
waveEl
autofocus
></canvas>
<canvas
#
waveEl
></canvas>
<div
class=
"time-line"
#
timeLineEl
>
<div
class=
"ctrl-bar"
>
</div>
...
...
form/src/app/common/lrc-editor/lrc-editor.component.ts
View file @
02edcc25
...
...
@@ -215,8 +215,8 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
this
.
adContext
.
decodeAudioData
(
ab
).
then
(
adb
=>
{
this
.
draw
(
adb
);
this
.
isLoadingAudioBuffer
=
false
;
(
document
.
activeElement
as
HTMLButtonElement
).
blur
();
this
.
canvasElRef
.
nativeElement
.
focus
();
//
(document.activeElement as HTMLButtonElement).blur();
//
this.canvasElRef.nativeElement.focus();
});
}
...
...
@@ -271,12 +271,11 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
e
.
stopPropagation
();
if
(
e
.
code
===
'
ArrowUp
'
)
{
this
.
togglePlayAudio
();
this
.
canvasElRef
.
nativeElement
.
focus
();
//
this.canvasElRef.nativeElement.focus();
}
if
(
e
.
code
===
'
ArrowDown
'
)
{
this
.
setTimestampPoint
();
this
.
canvasElRef
.
nativeElement
.
focus
();
//
this.canvasElRef.nativeElement.focus();
// set time point
}
if
(
e
.
code
===
'
ArrowLeft
'
)
{
...
...
@@ -285,7 +284,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
}
else
{
this
.
audioObj
.
currentTime
-=
1
;
}
this
.
canvasElRef
.
nativeElement
.
focus
();
//
this.canvasElRef.nativeElement.focus();
}
if
(
e
.
code
===
'
ArrowRight
'
)
{
...
...
@@ -294,7 +293,7 @@ export class LrcEditorComponent implements OnInit, OnChanges, OnDestroy, AfterVi
}
else
{
this
.
audioObj
.
currentTime
+=
1
;
}
this
.
canvasElRef
.
nativeElement
.
focus
();
//
this.canvasElRef.nativeElement.focus();
}
});
...
...
form/yarn.lock
View file @
02edcc25
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment