Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload button support #37

Closed
huobazi opened this issue Oct 19, 2015 · 2 comments
Closed

upload button support #37

huobazi opened this issue Oct 19, 2015 · 2 comments

Comments

@huobazi
Copy link

huobazi commented Oct 19, 2015

I like a upload button can browse local image or use camera on mobile devise

@jeremy jeremy mentioned this issue Oct 19, 2015
12 tasks
@jeremy
Copy link
Member

jeremy commented Oct 19, 2015

→ added to Roadmap Questions list!

@jeremy jeremy closed this as completed Oct 19, 2015
@tanin47
Copy link

tanin47 commented Nov 18, 2015

I've built one. Please see: https://github.com/tanin47/trix/pull/1/files

Here's how it works:

  1. The upload button is added to the toolbar. When clicked, it fires an event with triggerEvent 'click', onElement: @element.querySelector(fileSelector)
  2. The file dialog is open. The user can select a file.
  3. After a file is selected, element.editor.insertFile(file) is invoked.

Since we use element.editor.insertFile(file), you can use http://trix-editor.org/js/attachments.js to handle the uploaded file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants