Fixing selection problems, bug 179566

This commit is contained in:
mikep%oeone.com 2002-11-13 16:25:11 +00:00
Родитель 7fab8d26b2
Коммит 28a3cabb26
1 изменённых файлов: 17 добавлений и 12 удалений

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

@ -70,20 +70,26 @@ function resetAllowSelection()
Do not change anything in the following lines, they are needed as described in the Do not change anything in the following lines, they are needed as described in the
selection observer above selection observer above
*/ */
var SearchTree = document.getElementById( UnifinderTreeName ); doingSelection = false;
SearchTree.treeBoxObject.selection.selectEventsSuppressed = false;
SearchTree.addEventListener( "select", unifinderOnSelect, true );
}
var SearchTree = document.getElementById( UnifinderTreeName );
SearchTree.treeBoxObject.selection.selectEventsSuppressed = false;
SearchTree.addEventListener( "select", unifinderOnSelect, true );
}
var doingSelection = false;
function selectSelectedEventsInTree( EventsToSelect ) function selectSelectedEventsInTree( EventsToSelect )
{ {
if( doingSelection === true )
return;
doingSelection = true;
if( EventsToSelect === false ) if( EventsToSelect === false )
EventsToSelect = gCalendarWindow.EventSelection.selectedEvents; EventsToSelect = gCalendarWindow.EventSelection.selectedEvents;
//dump( "\nCALENDAR unifinder.js->on selection changed" ); dump( "\nCALENDAR unifinder.js->on selection changed" );
var SearchTree = document.getElementById( UnifinderTreeName ); var SearchTree = document.getElementById( UnifinderTreeName );
/* The following is a brutal hack, caused by /* The following is a brutal hack, caused by
@ -92,11 +98,10 @@ function selectSelectedEventsInTree( EventsToSelect )
http://bugzilla.mozilla.org/show_bug.cgi?id=168211 http://bugzilla.mozilla.org/show_bug.cgi?id=168211
Do NOT remove anything in the next 3 lines, or the selection in the tree will not work. Do NOT remove anything in the next 3 lines, or the selection in the tree will not work.
*/ */
SearchTree.treeBoxObject.selection.selectEventsSuppressed = true;
SearchTree.onselect = null; SearchTree.onselect = null;
SearchTree.removeEventListener( "select", unifinderOnSelect, true ); SearchTree.removeEventListener( "select", unifinderOnSelect, true );
SearchTree.treeBoxObject.selection.selectEventsSuppressed = true;
if( EventsToSelect.length == 1 ) if( EventsToSelect.length == 1 )
{ {
var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventsToSelect[0] ); var RowToScrollTo = SearchTree.eventView.getRowOfCalendarEvent( EventsToSelect[0] );
@ -132,7 +137,7 @@ function selectSelectedEventsInTree( EventsToSelect )
} }
/* This needs to be in a setTimeout */ /* This needs to be in a setTimeout */
setTimeout( "resetAllowSelection()", 0 ); setTimeout( "resetAllowSelection()", 1 );
} }
/** /**
@ -165,7 +170,7 @@ var unifinderEventDataSourceObserver =
{ {
if( calendarEvent ) if( calendarEvent )
{ {
refreshEventTree( getAndSetEventTable() ); refreshEventTree( getAndSetEventTable() );
} }
} }
}, },