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

file_list file download button not downloading file #1130

Closed
cggit opened this issue May 7, 2018 · 3 comments
Closed

file_list file download button not downloading file #1130

cggit opened this issue May 7, 2018 · 3 comments

Comments

@cggit
Copy link

cggit commented May 7, 2018

When uploading a PDF or Doc as a field type of "file_list" the resulting Download button from (Download/Remove) opens a media modal instead of downloading.

My fix is

.on( 'click', '.cmb-attach-list li, .cmb2-media-status .img-status img, .cmb2-media-status .file-status > span', cmb.handleFileClick )
to
.on( 'click', '.cmb2-media-status .img-status, .cmb2-media-status .file-status > span', cmb.handleFileClick )

and

CMB2/js/cmb2.js

Line 220 in 4bc8e98

var $el = $( this );
to
var $el = $( this ).hasClass('cmb2-media-item') ? $(this) : $(this).closest('.cmb2-media-item');

Can someone else confirm the problem and solution?

@jtsternberg
Copy link
Member

Can you paste the before/after code or open a PR, or link to the related lines in github? The lines you are referencing do not make sense.

https://github.com/CMB2/CMB2/blob/trunk/js/cmb2.js#L77
https://github.com/CMB2/CMB2/blob/trunk/js/cmb2.js#L169

@jtsternberg
Copy link
Member

I think it should be good now. Please test the trunk branch.

@cggit
Copy link
Author

cggit commented May 7, 2018

Great. That works too and is most slick! I updated my comment just so I know how to properly reference next time

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

2 participants