Ticket #979 (new defect)
Opera TypeError with mousedown used in conjunction with sortables
| Reported by: | ghouston | Owned by: | |
|---|---|---|---|
| Type: | defect | Priority: | major |
| Milestone: | Mootools version 1.2 | Component: | Core |
| Keywords: | Cc: |
Description
I upgraded from r1514 to r1537.
I am getting a TypeError? in both Opera 9.27 and 9.5b now when using mousedown events in conjunction with sortables that I was not getting with r1514. I am using similar code in a sortable dock and with sortable tabs. Both cease to function in Opera with r1537.
The mousedown/up functionality here has a slightly different purpose with my two use cases. With the sortable dock it allows clicking on the sortables item to destroy the item and restore a window. On the sortable tabs, it allows clicking on a tab and injecting the proper content in the content div. If the time between mousedown and mouseup is greater than 275ms seconds then a sortables drag can occur instead of the "click" function.
Simplified example working with r1514:
http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/index.html
Example broken with r1537:
http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/index-1537.html
Javascript:
window.addEvent('domready', function() {
this.tabSortables = new Sortables($('test'), {
opacity: .3,
constrain: true,
clone: false,
revert: false
});
$$('#test li').addEvent('mousedown', function(evt){
evt.stop();
this.timeDown = $time();
});
$$('#test li').addEvent('mouseup', function(evt){
this.timeUp = $time();
if ((this.timeUp - this.timeDown) < 275){
alert(this.timeUp);
}
});
});
HTML:
<ul id="test"> <li><a href="#">Text 01</a></li> <li><a href="#">Text 02</a></li> <li><a href="#">Text 03</a></li> <li><a href="#">Text 04</a></li> <li><a href="#">Text 05</a></li> <li><a href="#">Text 06</a></li> </ul>
Event thread: mousedown
Error:
name: TypeError?
message: Statement on line 94: Could not convert undefined or null to object
Backtrace:
Line 94 of linked script http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/scripts/mootools-trunk-1537.js
return arguments.callee.caller._parent_.apply(this, arguments);
Line 377 of linked script http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/scripts/mootools-trunk-1537.js
this.parent(C, B);
this.droppables = $$(this.options.droppables);
Line 90 of linked script http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/scripts/mootools-trunk-1537.js
for (F in Class.Mutators)
this.constructor = A;
if (E === $empty)
var C = this.initialize ? this.initialize.apply(this, arguments) : this;
Line 419 of linked script http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/scripts/mootools-trunk-1537.js
this.drag = new Drag.Move(this.clone, {snap : this.options.snap, container : this.options.constrain && this.element.getParent(), droppables : this.getDroppables(), onSnap : (function ()
{
B.stop();
this.clone.setStyle("visibility", "visible");
this.element.set("opacity", this.options.opacity
0);
this.fireEvent("onStart", [this.element, this.clone]);
}
).bind(this), onEnter : this.insert.bind(this), onCancel : this.reset.bind(this), onComplete : this.end.bind(this)});
Line 56 of linked script http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/scripts/mootools-trunk-1537.js
return A.apply(B.bind
null, C);
Line 57 of linked script http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/scripts/mootools-trunk-1537.js
return E();
Line 166 of linked script http://greghoustondesign.com/examples/mootools/bugs/opera-mousedown/scripts/mootools-trunk-1537.js
J = new Event(J, I.getWindow());
if (C.call(I, J) === false)
At unknown location
[statement source code not available]
Change History
Note: See TracTickets for help on using tickets.Download in other formats: