Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#2556 closed defect (fixed)

event.stopEvent method causes error on IE when using frames

Reported by: guest Owned by: alex
Priority: high Milestone: 0.9
Component: Events Version: 0.4.1
Keywords: Cc:
Blocked By: Blocking:


When the event originates from a different window then window.event is null and therefor in

   evt.cancelBubble = true;
   evt.returnValue = false;

the else block is executed which yields a "Object doesn't support this property or method" error.

I think the "if" clause should be changed to

   if(typeof(window.event) == "undefined"){

Change History (6)

comment:1 Changed 14 years ago by bill

Milestone: 0.9
Resolution: fixed
Status: newclosed

In 0.9 this code has been changed to:

	dojo.stopEvent = function(/*Event*/evt){
		// summary:
		//		prevents propagation and clobbers the default action of the
		//		passed event
		// evt: Optional for IE. The native event object.

Looks fixed. The comment is obviously wrong though so I'll fix that.

comment:2 Changed 14 years ago by bill

(In [9823]) Fix comments (evt is obviously not optional). Refs #2556.

comment:3 Changed 14 years ago by sjmiles

Resolution: fixed
Status: closedreopened

Farther down in the file we have:

365		// override stopEvent for IE
366		dojo.stopEvent = function(evt){
367		evt = evt || window.event;

So the documentation was actually correct, although (afaik) it's an open question how the documentation engine handles such overrides.

comment:4 Changed 14 years ago by sjmiles

(In [9828]) Comments hopefully clarified, refs #2556.

comment:5 Changed 14 years ago by sjmiles

Resolution: fixed
Status: reopenedclosed

comment:6 Changed 14 years ago by Adam Peller

(In [9829]) Minor style, spelling changes. Refs #2556

Note: See TracTickets for help on using tickets.