-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
404 additions
and
17,979 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
{{! input for include in form }} | ||
<input | ||
id={{@id}} | ||
type="hidden" | ||
name="{{concat 'trix-editor-input-' @id}}" | ||
value={{this.value}} | ||
/> | ||
{{! the editor }} | ||
<trix-editor | ||
{{trix-listener this.trixEventHandler}} | ||
input={{@id}} | ||
...attributes | ||
/> |
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,29 @@ | ||
import Component from '@glimmer/component'; | ||
import { action } from '@ember/object'; | ||
import { camelize } from '@ember/string'; | ||
import { typeOf } from '@ember/utils'; | ||
|
||
export default class TrixInputComponent extends Component | ||
{ | ||
|
||
get value() { return this.args.value ?? ''; } | ||
/** | ||
* handle all events from trix which are registered in the modifier | ||
* @param event | ||
*/ | ||
@action trixEventHandler(event) | ||
{ | ||
let eName = camelize(event.type); | ||
// pass event up | ||
if (typeOf(this.args[eName]) === 'function') | ||
{ | ||
this.args[eName](event); | ||
} | ||
// trigger convenient onChange action | ||
if (eName === 'trixChange' && typeOf(this.args.onChange) === 'function') | ||
{ | ||
this.args.onChange(event.target.innerHTML); | ||
} | ||
|
||
} | ||
} |
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
This file was deleted.
Oops, something went wrong.
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 @@ | ||
export { default } from 'ember-trix/components/trix-input'; |
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
Oops, something went wrong.