insert images inline when dropped in create mode

pull/4755/head
manuschiller 8 years ago committed by Oliver Günther
parent f596b34d1a
commit c084b6c2f3
  1. 4
      frontend/app/components/work-packages/wp-attachments-formattable-field/wp-attachments-formattable.directive.ts

@ -134,7 +134,9 @@ export class WpAttachmentsFormattableController {
protected insertDelayedAttachments(dropData:DropModel, description):void { protected insertDelayedAttachments(dropData:DropModel, description):void {
for (var i = 0; i < dropData.files.length; i++) { for (var i = 0; i < dropData.files.length; i++) {
description.insertAttachmentLink(dropData.files[i].name.replace(/ /g, '_'), InsertMode.ATTACHMENT, true); var currentFile = new SingleAttachmentModel(dropData.files[i]);
var insertMode = currentFile.isAnImage ? InsertMode.INLINE : InsertMode.ATTACHMENT;
description.insertAttachmentLink(dropData.files[i].name.replace(/ /g, '_'), insertMode, true);
this.$rootScope.$broadcast('work_packages.attachment.add', dropData.files[i]); this.$rootScope.$broadcast('work_packages.attachment.add', dropData.files[i]);
} }

Loading…
Cancel
Save