Coder Social home page Coder Social logo

droppableview.js's Introduction

DroppableView.js

In the current version of Famo.us, "interactions such as drag and drop are harder to implement, but this is intended and we are working on an elegant solution for these use-cases." The reason is there are no absolute positions available through Surfaces. This is an implementation of a DroppableView done in 24 hours. It's meant as an exercise and shouldn't be used for production code.

API

Extends View. Useful for quickly adding renderables with drag and drop behavior. Special add methods must be used to add a renderable as a Draggable or a Droppable. Utilizes workarounds dealing with Surface's lack of absolute positioning. Not meant to see the light of day.

Emits event: 'drop' whenever a draggable element is successfully dropped into a Droppable element. The event contains the rendered elements as 'draggable' and 'droppable', ready for further manipulation.

EXAMPLES: main.js. Open index.html to see.


add -- Add a child renderable to the view. Note: this will not give the renderable drag or drop properties

RETURNS RenderNode


addDraggable(child, options) -- Add a child renderable to the view as a draggable element. The translations cannot be chained normally, and must be passed on as options.

PARAMETERS | | ------------- | ------------- | ------------- child | Object |The renderable you want to be draggable options (optional) | Object | Same options as you would pass into a Modifier


addDroppable(child, options) -- Add a child renderable to the view as a droppable element. The translations cannot be chained normally, and must be passed on as options.

PARAMETERS | | ------------- | ------------- | ------------- child | Object | The renderable you want to be draggable options (optional)| Object | Same options as you would pass into a Modifier

droppableview.js's People

Contributors

johnz133 avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.