This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0
This library handles drag and drop of style elements using the HTML5 API
version 1.0.3
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.3
Committed At 2017-07-02 16:35:24 UTC
mdgriffith/style-elements 3.2.3 <= v < 4.0.0 3.4.1
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

README

HTML 5 Drag and Drop API for Style Elements

This library handles dragging and dropping using the API from the HTML 5 recommendation at https://www.w3.org/TR/html/editing.html#drag-and-drop.

It provides attributes and a model/update to handle dragging and dropping between your elements.

This is a straight port of https://github.com/norpan/elm-html5-drag-drop to support the Style Elements

Usage

type alias Model =
    { ...
    , dragDrop : Html5.DragDrop.Model DragId DropId
    }


type Msg
    = ...
    | DragDropMsg (Html5.DragDrop.Msg DragId DropId)


update msg model =
    case msg of
        ...
        DragDropMsg msg_ ->
            let
                ( model_, result ) =
                    Html5.DragDrop.update msg_ model.dragDrop
            in
                { model
                    | dragDrop = model_
                    , ...use result if available...
                }


view =
   ...
   el (... ++ Html5.DragDrop.draggableElement DragDropMsg dragId) (...)
   ...
   row (... ++ Html5.DragDrop.droppableElement DragDropMsg dropId) [...]