🐛 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:
Kevin Ansfield 2018-08-01 12:36:02 +01:00
parent f4a21bd1f6
commit 4cf9220ef4
2 changed files with 3 additions and 1 deletions

View File

@ -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;
}
}

View File

@ -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'}),