tomitrescak / meteor-uploads

MIT License
295 stars 41 forks source link

upload_bootstrap template browse button disabled #38

Closed subatomicceo closed 9 years ago

subatomicceo commented 9 years ago

Cannot use {{> upload_bootstrap }} because the browse button renders with disabled as a class making it unclickable.

tomitrescak commented 9 years ago

Can you create minimally reproducible application or a meteorpad example? On my end all is good.

subatomicceo commented 9 years ago

Unable to recreate in a meteorpad however upon further inspection I noticed the issue appears to be cause by packages/tomi:upload-jquery/uploader.js lines 232 & 233.

.prop('disabled', !$.support.fileInput);
.parent().addClass($.support.fileInput ? undefined : 'disabled');

It appears that $.support.fileInput is null when logging thereby causing my input buttons to always render as disabled.

tomitrescak commented 9 years ago

What browser are you using? jQuery is detecting that your browser is not supporting fileInput. If you run $.support in browser console the "fileInput" has to be true. This solution should work on all "modern" browsers.

subatomicceo commented 9 years ago

Using Google Chrome: Version 40.0.2214.111 (64-bit) on OSX Yosemite v10.10. Shot in the dark here but maybe because I have a new browser and '$.support' is deprecated?

Found this: "For your own project's feature-detection needs, we strongly recommend the use of an external library such as Modernizr instead of dependency on properties in jQuery.support."

Src: http://api.jquery.com/jquery.support/

screen shot 2015-02-12 at 10 16 06 pm

tomitrescak commented 9 years ago

Wow. Looks like a jQuery issue then. I have exactly the same configuration as you do and it works just fine. Which version of jQuery you use? I guess it’s the standard one from meteor?

ScreenShot

I’ll investigate, if you find out anything, please let me know.

On 13 February 2015 at 17:25:55, Greg Parks (notifications@github.com) wrote:

40.0.2214.111

subatomicceo commented 9 years ago

Aha! I was using jQuery v2.1.3, so I switched to v1.11.3 and viola! Thanks for all your help and for your awesome plugin!

tomitrescak commented 9 years ago

Good catch! Have to update it so that I support also the latest jquery. Thanks for you help! Glad you like the plugin. Still a long way to go to have all I like. Next destination are chunked uploads and resume;)

genjurosama commented 9 years ago

is this issue resolved yet , i'm experiencing the same problem . how can i downgrade the version of my Meteor Jquery default package?

tomitrescak commented 9 years ago

Plugin works with default jquery. Only if you install a new version then you may run into these problems. Tested on Mac and Linux. I didn't have time to look into this issue further:: On Sat, 14 Mar 2015 at 04:58 genjurosama notifications@github.com wrote:

is this issue resolved yet , i'm experiencing the same problem . how can i downgrade the version of my Meteor Jquery default package?

Reply to this email directly or view it on GitHub https://github.com/tomitrescak/meteor-uploads/issues/38#issuecomment-79191888 .

genjurosama commented 9 years ago

i use the default jquery that comes with Meteor

tomitrescak commented 9 years ago

That is not possible, the default version is v1.11.3 At least as tested on Mac

If you put meteor list what do you see?

I see jquery 1.11.3 Manipulate the DOM using CSS selectors

mitesh-mutha commented 9 years ago

I am facing the same problem. Dropzone works but upload_bootstrap doesn't. I even installed the jquery plugin 1.11.3_2 additionally to check if it works and it doesn't. The issue remains the same.

I have tried in Firefox as well as Chrome now. Let me know how i can solve this issue. The browse button is not seen itself.

screenshot from 2015-07-02 21 04 05

wroosenburg commented 9 years ago

I've seen the same issue when I updated, but it was not the disabled property causing the trouble but the 'style:left;' attribute causing the browse button to disappear. Try this in your template rendered callback:

$('.btn-file').removeAttr('style');

Not a permanent solution, but this works for me in the meantime.

mitesh-mutha commented 9 years ago

Yes @spikey82 , your solution does indeed work. Thanks. I will take this for now.

devonwesley commented 9 years ago

Nevermind my mistake. Thanks for the package bro its great!

tomitrescak commented 9 years ago

Guys, can anyone address this bug maybe? I'm really miserable on time right now. PR would be very welcome :100:

tomitrescak commented 9 years ago

Nevermind. 2.1.7 resolves this issue. Sorry about that.