Page MenuHomePhorge

D25134.1736704972.diff
No OneTemporary

D25134.1736704972.diff

diff --git a/webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js b/webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js
--- a/webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js
+++ b/webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js
@@ -27,11 +27,15 @@
drop.listen('didUpload', function(file) {
JX.TextAreaUtils.insertFileReference(target, file);
- var metadata = new JX.RemarkupMetadata(config.remarkupMetadataValue,
- config.remarkupMetadataID);
- var phids = metadata.getMetadata('attachedFilePHIDs', []);
- phids.push(file.getPHID());
- metadata.setMetadata('attachedFilePHIDs', phids);
+ if(config.remarkupMetadataID) {
+ // Try to auto-attach files by default
+ // https://we.phorge.it/T15106
+ var metadata = new JX.RemarkupMetadata(config.remarkupMetadataValue,
+ config.remarkupMetadataID);
+ var phids = metadata.getMetadata('attachedFilePHIDs', []);
+ phids.push(file.getPHID());
+ metadata.setMetadata('attachedFilePHIDs', phids);
+ }
});
drop.start();

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 12, 18:02 (5 d, 4 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1108705
Default Alt Text
D25134.1736704972.diff (1 KB)

Event Timeline