Hi all, I'm doing a drag-proxy like this:
--- this.element = element; this._proxy = this.element.cloneNode(true); this._proxy.absolutize(); this._proxy.style.opacity = 0.7; this._proxy.clonePosition(element); this._proxy.observe('mouseup', this.destroy.bind(this)); this.element.observe('mouseup', this.destroy.bind(this)); document.body.appendChild(this._proxy); new Draggable(this._proxy).initDrag(ev); --- which is necessary so that the draggable is rendered as a child of document.body and therefore can float over scrollable divs. However, now the proxy captures mouseup events, which nullifies the original element's click and doubleclick events (probably not the best idea to have mousdown, up, click, and doubleclick all on one element, but oh well). So I want to route event bubbling from the proxy to the parent, but keep the proxy a child of document.body. I think I only really need to route mouseup. So I tried this: --- this._proxy.observe('mouseup', function(ev) {this.element.dispatchEvent(ev);}.bind(this)); --- but that throws this error, which is rather incomprehensible: --- [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMEventTarget.dispatchEvent]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://localhost:3000/javascripts/behaviors.js?1211228591 :: anonymous :: line 12" data: no] --- Can anyone please shed some light on how to approach this problem? Thanks, Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---