diff options
author | Christoph (Sheogorath) Kern | 2019-03-31 15:14:31 +0200 |
---|---|---|
committer | GitHub | 2019-03-31 15:14:31 +0200 |
commit | 3a0ff5edd3882cca3751bcfbca1843807ef0c7d7 (patch) | |
tree | f14f4411361f789f05d8414378df3c9ea9a07c03 /public/js/lib/editor/index.js | |
parent | 948c3367eb07505383367ab722d240fa62ca454a (diff) | |
parent | 1544b45af5435fde1190634dc44b65ca6ab55238 (diff) |
Merge pull request #9 from SISheogorath/feature/moveUpload
Move upload button into toolbar
Diffstat (limited to '')
-rw-r--r-- | public/js/lib/editor/index.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.js index f05d01b8..17d30ca4 100644 --- a/public/js/lib/editor/index.js +++ b/public/js/lib/editor/index.js @@ -138,6 +138,7 @@ export default class Editor { } addToolBar () { + var inlineAttach = inlineAttachment.editors.codemirror4.attach(this.editor) this.toolBar = $(toolBarTemplate) this.toolbarPanel = this.editor.addPanel(this.toolBar[0], { position: 'top' @@ -157,6 +158,7 @@ export default class Editor { var makeTable = $('#makeTable') var makeLine = $('#makeLine') var makeComment = $('#makeComment') + var uploadImage = $('#uploadImage') makeBold.click(() => { utils.wrapTextWith(this.editor, this.editor, '**') @@ -217,6 +219,13 @@ export default class Editor { makeComment.click(() => { utils.insertText(this.editor, '> []') }) + uploadImage.bind('change', function (e) { + console.log("tiggered") + var files = e.target.files || e.dataTransfer.files + e.dataTransfer = {} + e.dataTransfer.files = files + inlineAttach.onDrop(e) + }) } addStatusBar () { |