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/4fb9535a-711b-4299-b11e-2df21ce17a77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.