Hi Ronn - did you ever figure this out?  I have a similar requirement for 
my app and would like to use native elm if possible.
  

On Monday, May 16, 2016 at 6:09:18 PM UTC-4, Ronn Ross wrote:
>
> Still no luck, but I'm getting closer. The problem is I'm not sure how to 
> build the decoder for the drop event. Dragging and dropping is working 
> great I just need to get the file information from the drop event. In Js 
> you can get the files array from the event using
>
>     event.data transfer.files
>
> Within the files array there is an object for each file containing name, 
> fileSize, etc.
>
> I can't figure out how to decode the object being returned, nor can i find 
> a way to see the object to start debugging. Here is my function.
>
>
> assetArea : Html Msg
> assetArea =
>   div [ class "asset-area"
>         , onWithOptions "dragenter" (Options True True) (Json.succeed 
> (DropEvent "dragenter"))
>         , onWithOptions "dragover" (Options True True) (Json.succeed 
> (DropEvent "dragover"))
>         , onWithOptions "drop" (Options True True) (Json.map (\x -> log 
> "whatever" x) (Json.succeed (DropEvent "drop")))
>         ]
>     [ text "Drop here" ]
>
> Here is an example in Js. 
>
> https://jsfiddle.net/0GiS0/4ZYq3/
>
> I've read the Json.decoder docs, but still having trouble. Can someone 
> point me in the right direction?
>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to