Hi! i'm trying to rewrite the source of
this 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?