-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't hide the Juke icon when focus is inside the input #3784
- Loading branch information
1 parent
85eb248
commit 7eb9794
Showing
10 changed files
with
171 additions
and
174 deletions.
There are no files selected for viewing
70 changes: 0 additions & 70 deletions
70
src/main/resources/assets/admin/common/js/ai/AiControls.ts
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
src/main/resources/assets/admin/common/js/ai/AiDialogControl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as Q from 'q'; | ||
import {Button} from '../ui/button/Button'; | ||
import {i18n} from '../util/Messages'; | ||
import {AiContentOperatorOpenDialogEvent} from './event/AiContentOperatorOpenDialogEvent'; | ||
|
||
export class AiDialogControl | ||
extends Button { | ||
|
||
private dataPath?: string; | ||
|
||
constructor() { | ||
super(); | ||
|
||
this.initListeners(); | ||
} | ||
|
||
setDataPath(dataPath: string): AiDialogControl { | ||
this.dataPath = dataPath; | ||
return this; | ||
} | ||
|
||
getDataPath(): string { | ||
return this.dataPath; | ||
} | ||
|
||
protected initListeners(): void { | ||
this.onClicked(() => { | ||
if (this.dataPath) { | ||
new AiContentOperatorOpenDialogEvent(this.dataPath).fire(); | ||
} | ||
}); | ||
} | ||
|
||
doRender(): Q.Promise<boolean> { | ||
return super.doRender().then((rendered: boolean) => { | ||
this.addClass('ai-dialog-control').setTitle(i18n('ai.action.contentOperator.use')); | ||
|
||
return rendered; | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/resources/assets/admin/common/js/ai/AiStateControl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {DivEl} from '../dom/DivEl'; | ||
import {AiHelperState} from './AiHelperState'; | ||
|
||
export class AiStateControl | ||
extends DivEl { | ||
|
||
constructor() { | ||
super(); | ||
|
||
this.setState(AiHelperState.DEFAULT); | ||
} | ||
|
||
setState(state: AiHelperState): this { | ||
this.setClass(`ai-state-control ${state}`); | ||
|
||
return this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/resources/assets/admin/common/styles/api/ai/ai-dialog-control.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
button.ai-dialog-control { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 20px; | ||
height: 20px; | ||
box-sizing: border-box; | ||
font-size: 16px; | ||
padding: 0; | ||
|
||
&:not(:hover):not(:focus):not(:focus-within):not(.input-focused) { | ||
display: none; | ||
} | ||
|
||
background: transparent; | ||
|
||
&:hover:not(:disabled) { | ||
background: transparent; | ||
} | ||
|
||
&::before { | ||
content: ''; | ||
display: inline-block; | ||
width: 1em; | ||
height: 1em; | ||
background: url("../../../images/juke-eye-centered.svg") center / contain no-repeat; | ||
} | ||
} | ||
|
Oops, something went wrong.