Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/core/behavior-drag-and-drop-textarea.js
Show All 21 Lines | if (text.match(/^\{F/)) { | ||||
ref = text + '\n\n' + ref; | ref = text + '\n\n' + ref; | ||||
} | } | ||||
JX.TextAreaUtils.setSelectionText(target, ref); | JX.TextAreaUtils.setSelectionText(target, ref); | ||||
} | } | ||||
if (JX.PhabricatorDragAndDropFileUpload.isSupported()) { | if (JX.PhabricatorDragAndDropFileUpload.isSupported()) { | ||||
var drop = new JX.PhabricatorDragAndDropFileUpload(target) | var drop = new JX.PhabricatorDragAndDropFileUpload(target) | ||||
.setURI(config.uri); | .setURI(config.uri) | ||||
.setChunkThreshold(config.chunkThreshold); | |||||
drop.listen('didBeginDrag', function() { | drop.listen('didBeginDrag', function() { | ||||
JX.DOM.alterClass(target, config.activatedClass, true); | JX.DOM.alterClass(target, config.activatedClass, true); | ||||
}); | }); | ||||
drop.listen('didEndDrag', function() { | drop.listen('didEndDrag', function() { | ||||
JX.DOM.alterClass(target, config.activatedClass, false); | JX.DOM.alterClass(target, config.activatedClass, false); | ||||
}); | }); | ||||
drop.listen('didUpload', onupload); | drop.listen('didUpload', onupload); | ||||
drop.start(); | drop.start(); | ||||
} | } | ||||
}); | }); |