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

Make dropzone message clickable #91

Merged
merged 1 commit into from Apr 5, 2013
Merged

Conversation

njx
Copy link
Contributor

@njx njx commented Apr 5, 2013

In the current build of Dropzone, you can click anywhere in the drop zone to bring up the browse dialog except the "Drop files here or click" message, which is a little odd. This patch should fix that.

I wasn't able to test the patch as-is, because I couldn't build properly with grunt (stylus complained that it couldn't find nib, and the built JS file didn't seem to work). I did test basically the same patch in (a slightly older version of) the checked-in JS file and basic.css, and it worked. So, hopefully it will work for you :)

@@ -35,7 +35,7 @@

&.clickable
cursor pointer
.message
.message, .message span
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That shouldn't be necessary, should it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... yes it is. I just now realised that I've never experienced those problems because I always used the substitute image.

enyo added a commit that referenced this pull request Apr 5, 2013
Make dropzone message clickable
@enyo enyo merged commit 9a7e708 into dropzone:develop Apr 5, 2013
enyo added a commit that referenced this pull request Apr 5, 2013
@enyo
Copy link
Collaborator

enyo commented Apr 5, 2013

Thanks for the stylus info. I fixed that as well.

@enyo
Copy link
Collaborator

enyo commented Apr 5, 2013

I went for a bit of a different approach though. I added a function Dropzone.elementInside() so that any child element passes now. The line looks like this now:

if evt.target == @element or Dropzone.elementInside evt.target, @element.querySelector ".message"

@njx njx deleted the click-message branch April 5, 2013 14:32
@njx
Copy link
Contributor Author

njx commented Apr 5, 2013

That makes sense (I was going for a minimal change since I'm not a CoffeeScript expert). However, that probably means you should also change the selector in basic.styl to .message, .message * instead of just .message, .message span (I didn't see that in your followup commit).

Thanks for Dropzone by the way--really easy to use and looks great!

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.

None yet

2 participants