Hi , i did the trick by changing "this" to 
document.querySelector('drag-resizen').focus(element); , but i'm not sure 
if its the best practice . I would like to see some opinions about the 
implementation , Thanks!

El martes, 10 de mayo de 2016, 20:55:12 (UTC-4), Gonzalo Tirapegui escribió:
>
> Hi! i'm trying to rewrite the source of this 
> <https://github.com/manekinekko/drag-resize/blob/master/drag-resize.html> 
> drag 
> and drop component from the 0.5 to 1.0 version of Polymer . In the domReady 
> method a listener function is attached to the parent document object to be 
> triggered on the mousedown event , and in the lines 769 and 772 the "focus" 
> and "blur" functions of the drag-resize component are called . Now , if i 
> try to add the event listener by the listen function i get the error 
> "Uncaught TypeError : Invalid value used as weak map key" , and if i try 
> this code :
>
> this.ownerDocument.addEventListener('mousedown', function(event){
>         var element = event.srcElement || event.target;
>         var filteredElements = element.classList.contains('drag-resize') 
> || element.classList.contains('drag-resize-handlers') || 
> element.getAttribute('drag-resizen') !== null;
>         if(!element.classList.contains('drag-resize')){
>           if(filteredElements){
>             this.focus(element);
>           }
>           else {
>             this.blur(true);
>           }          
>         }
>       });
>
>   the "this" operator on the call to the focus and the blur function 
> executes the parent document functions , not the drag-resize focus and blur 
> methods , and as you can see the drag-resize element on the 0.5 version it 
> execute it's own focus and blur method. So , how can this can be done on 
> Polymer 1.0?
>

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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/57413f33-48c6-4473-b24f-6512ae7769be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to