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

Add toolbar button for attaching files #619

Merged
merged 1 commit into from
Apr 19, 2019
Merged

Add toolbar button for attaching files #619

merged 1 commit into from
Apr 19, 2019

Conversation

javan
Copy link
Contributor

@javan javan commented Apr 19, 2019

file-tool

Fixes #594
Fixes #582
Closes #617

@javan javan merged commit 9fc0c9c into master Apr 19, 2019
@javan javan deleted the file-picker branch April 19, 2019 20:49
@SylarRuby
Copy link

Hi @javan Ive updated actiontext as Im using rails 6 rc1 but Im unable to see the attach icon. Do we need to manually enable it somewhere? if so, where?

@javan
Copy link
Contributor Author

javan commented May 6, 2019

This change hasn't been released yet. Hoping to do so soon.

@javan javan mentioned this pull request May 21, 2019
@andreibondarev
Copy link

@javan Any plans to roll out 1.1.2 with this feature any time soon? Thank you for all your work!

@javan
Copy link
Contributor Author

javan commented Jul 29, 2019

Trix 1.2.0 is out now and includes this feature.

pull bot pushed a commit to tloudon/rails that referenced this pull request Jul 30, 2019
Adds an attachment button to the Trix toolbar that improves overall file upload usability, especially on mobile devices where files can't be dragged / dropped.

References:
- https://github.com/basecamp/trix/releases/tag/1.2.0
- basecamp/trix#619
- basecamp/trix#582
javan added a commit to rails/rails that referenced this pull request Mar 9, 2020
Adds an attachment button to the Trix toolbar that improves overall file upload usability, especially on mobile devices where files can't be dragged / dropped.

References:
- https://github.com/basecamp/trix/releases/tag/1.2.0
- basecamp/trix#619
- basecamp/trix#582
@vpavlov10
Copy link

@javan could you please explain if it's possible to configure the certain file extensions to be available in a dialog box?
I want to allow users upload the images only (.jpg, .png etc.)
Thanks in advance!

@vpavlov10
Copy link

Since there is no event triggering the button click, this is only the way I found to make it work (jQuery example):
$(function () { $(document).bind("DOMNodeInserted",function() { $('[id^="trix-file-input-"]').attr('accept', 'image/*'); }); });

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

Successfully merging this pull request may close these issues.

add file attachment in toolbar and custom preview Add "insert image" button to default setup
4 participants