mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 12:21:36 +03:00
🐛 Koenig - Fixed duplicate images when dropping image file on an image card
refs https://github.com/TryGhost/Ghost/issues/9724
- `card.handlesDragDrop` was never accessible, it would have had to be registered through `card.koenigOptions.handlesDragDrop` when the drop handling was first added
- as of cc2e20a486
properties on card components are directly accessible so we can use `card.component.handlesDragDrop` to guard against the editor handling drops on cards that handle their own drops
This commit is contained in:
parent
f4a21bd1f6
commit
4cf9220ef4
@ -902,7 +902,7 @@ export default Component.extend({
|
||||
if (cardElem) {
|
||||
let cardId = cardElem.firstChild.id;
|
||||
let card = this.componentCards.findBy('destinationElementId', cardId);
|
||||
if (card.isEditing || card.handlesDragDrop) {
|
||||
if (card.isEditing || card.component.handlesDragDrop) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
import createComponentCard from '../utils/create-component-card';
|
||||
|
||||
// TODO: move koenigOptions directly into cards now that card components register
|
||||
// themselves so that they are available on card.component
|
||||
export default [
|
||||
createComponentCard('card-markdown'), // backwards-compat with markdown editor
|
||||
createComponentCard('code', {deleteIfEmpty: 'payload.code'}),
|
||||
|
Loading…
Reference in New Issue
Block a user