mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Koenig - Allow clicks on rich-text captions to place cursor immediately
refs https://github.com/TryGhost/Ghost/issues/9724 - add a `data-kg-allow-clickthrough` attribute so that it's possible to explicitly allow non-input elements to be clicked immediately when clicking on a card
This commit is contained in:
parent
fbcc320f54
commit
fe13a46273
2 changed files with 5 additions and 2 deletions
|
@ -152,7 +152,9 @@ export default Component.extend({
|
|||
// immediately when clicked
|
||||
let targetTagName = event.target.tagName;
|
||||
let allowedTagNames = ['INPUT', 'TEXTAREA'];
|
||||
if (!allowedTagNames.includes(targetTagName)) {
|
||||
let allowClickthrough = !!event.target.closest('[data-kg-allow-clickthrough]');
|
||||
console.log('allowClickthrough', allowClickthrough);
|
||||
if (!allowedTagNames.includes(targetTagName) && !allowClickthrough) {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<div class="koenig-basic-html-input__editor-wrappper">
|
||||
<div class="koenig-basic-html-input__editor-wrappper" style="cursor: text">
|
||||
<div
|
||||
class="koenig-basic-html-input__editor"
|
||||
data-gramm="false"
|
||||
data-kg="editor"
|
||||
data-kg-allow-clickthrough
|
||||
data-placeholder={{placeholder}}
|
||||
></div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue