How to implement movable , resizable , not intersectable components

62 views
Skip to first unread message

Gonzalo Tirapegui

unread,
Feb 29, 2016, 8:37:39 PM2/29/16
to Polymer
Hi

     I'm trying to implement a component that handles inner components , this inner components needs to be movable with the mouse (inside the limits of the parent component) , resizable and must not intersect between each other when the user resizes or moves it. The problem is that every time an inner component is moved or resized needs to know the position of their "brothers" , but as we all know every component can access only its shadow dom and must not be able to query the properties of the parent or the "brothers" , at least from the javascript of the inner components , so i need to understand which is the best way to think this problem and implement it.


    Regards , Gonzalo.

daci...@gmail.com

unread,
Mar 30, 2016, 8:17:16 AM3/30/16
to Polymer
Thats funny. I'm doing something similar, but it's the layout-manager that moves around the components. I guess no one answered this, because the question is quite unspecific, and has more than one solution. I'm using the "outer component" as a mediator. The inner components create events, that the the outer component listens for and publishes them back to the other inner components.This is the common Use-the-DOM-Luke-approach you find in Polymer-apps ;)

王納米

unread,
Mar 30, 2016, 11:09:18 PM3/30/16
to daci...@gmail.com, Polymer
We did sth similar several months ago, we use interact.js inside a manager component.

On Wed, Mar 30, 2016 at 8:17 PM <daci...@gmail.com> wrote:
Thats funny. I'm doing something similar, but it's the layout-manager that moves around the components. I guess no one answered this, because the question is quite unspecific, and has more than one solution. I'm using the "outer component" as a mediator. The inner components create events, that the the outer component listens for and publishes them back to the other inner components.This is the common Use-the-DOM-Luke-approach you find in Polymer-apps ;)

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/9c62cc29-62e8-4bf8-8b6e-ccc77c0c9341%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages