Move preventBubble calls to the top of all relevant handlers to avoid an extremely confusing debugging experience if something in the handler throws an exception. Also, fix a JS strict warning. r=vlad. Not part of the build.

This commit is contained in:
dmose%mozilla.org 2005-05-28 02:47:44 +00:00
Родитель 48aaf7dad4
Коммит dc273d98d8
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -216,6 +216,7 @@
<handlers> <handlers>
<handler event="mousedown" button="0"><![CDATA[ <handler event="mousedown" button="0"><![CDATA[
event.preventBubble();
var whichside = this.getAttribute("whichside"); var whichside = this.getAttribute("whichside");
if (!whichside) if (!whichside)
return; return;
@ -227,7 +228,6 @@
evbox.calendarView.selectedOccurrence = evbox.mOccurrence; evbox.calendarView.selectedOccurrence = evbox.mOccurrence;
// then start dragging it // then start dragging it
evbox.parentColumn.startSweepingToModifyEvent(evbox, evbox.mOccurrence, whichside, event.screenX, event.screenY); evbox.parentColumn.startSweepingToModifyEvent(evbox, evbox.mOccurrence, whichside, event.screenX, event.screenY);
event.preventBubble();
]]></handler> ]]></handler>
</handlers> </handlers>
</binding> </binding>
@ -1245,11 +1245,11 @@
<handlers> <handlers>
<handler event="mousedown"><![CDATA[ <handler event="mousedown"><![CDATA[
event.preventBubble();
this.calendarView.selectedOccurrence = this.mOccurrence; this.calendarView.selectedOccurrence = this.mOccurrence;
if (this.mOccurrence.item.recurrenceInfo) { if (this.mOccurrence.item.recurrenceInfo) {
// XXXvv can't drag recurring events yet, FIXME // XXXvv can't drag recurring events yet, FIXME
event.preventBubble();
return; return;
} }
@ -1257,7 +1257,6 @@
this.mMouseX = event.screenX; this.mMouseX = event.screenX;
this.mMouseY = event.screenY; this.mMouseY = event.screenY;
this.mMouseTime = event.timeStamp; this.mMouseTime = event.timeStamp;
event.preventBubble();
]]></handler> ]]></handler>
<handler event="mousemove"><![CDATA[ <handler event="mousemove"><![CDATA[
@ -1279,10 +1278,11 @@
]]></handler> ]]></handler>
<handler event="dblclick"><![CDATA[ <handler event="dblclick"><![CDATA[
event.preventBubble();
if (this.calendarView.controller && this.mOccurrence) { if (this.calendarView.controller && this.mOccurrence) {
this.calendarView.controller.modifyOccurrence(this.mOccurrence); this.calendarView.controller.modifyOccurrence(this.mOccurrence);
} }
event.preventBubble();
]]></handler> ]]></handler>
</handlers> </handlers>
</binding> </binding>
@ -1424,7 +1424,7 @@
onDefaultCalendarChanged: function (aNewDefaultCalendar) { onDefaultCalendarChanged: function (aNewDefaultCalendar) {
// don't care, for now // don't care, for now
}, }
}) })
]]></field> ]]></field>