Bug 295424 share code to set up tooltip content for unifinder, unifinderToDo.

patch by gekacheka@yahoo.com, r=mvl
This commit is contained in:
mvl%exedo.nl 2005-06-01 12:55:50 +00:00
Родитель 09f1d37491
Коммит 93fcf209d9
5 изменённых файлов: 42 добавлений и 42 удалений

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

@ -480,11 +480,11 @@
<!-- tooltips to show cropped text behave as a titletip: don't hide until mouse moved away -->
<tooltip id="eventTreeTooltip"
onpopupshowing="return changeToolTipTextForEvent( event );"
onpopupshowing="return onMouseOverEventTree( this, event )"
noautohide="true"/>
<tooltip id="taskTreeTooltip"
onpopupshowing="return changeToolTipTextForToDo( event );"
onpopupshowing="return onMouseOverTaskTree( this, event )"
noautohide="true"/>
<tooltip id="gridOccurrenceTooltip"

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

@ -49,6 +49,44 @@
some of it duplicated.)
**/
/** For all instances of an event, as displayed by unifinder. **/
function onMouseOverEventTree( toolTip, mouseEvent )
{
var item = getCalendarEventFromEvent( mouseEvent );
if (isEvent(item)) {
var holderBox = getPreviewForEvent(item);
if (holderBox) {
setToolTipContent(toolTip, holderBox);
return true;
}
}
return false;
}
/** For all instances of a task, as displayed by unifinderToDo. **/
function onMouseOverTaskTree( toolTip, mouseEvent )
{
var item = getToDoFromEvent( mouseEvent );
if (isToDo(item)) {
var holderBox = getPreviewForTask(item);
if (holderBox) {
setToolTipContent(toolTip, holderBox);
return true;
}
}
return false;
}
/*
** add newContentBox,
*/
function setToolTipContent(toolTip, holderBox)
{
while (toolTip.hasChildNodes())
toolTip.removeChild( toolTip.firstChild );
toolTip.appendChild( holderBox );
}
/**
* Called when a user hovers over a todo element and the text for the mouse over is changed.
*/

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

@ -745,22 +745,3 @@ function focusFirstItemIfNoSelection()
}
}
function changeToolTipTextForEvent( event )
{
var thisEvent = getCalendarEventFromEvent( event );
var toolTip = document.getElementById( "eventTreeTooltip" );
while( toolTip.hasChildNodes() )
{
toolTip.removeChild( toolTip.firstChild );
}
var holderBox = getPreviewForEvent( thisEvent );
if (holderBox) {
toolTip.appendChild( holderBox );
return true;
} else {
return false;
}
}

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

@ -602,25 +602,6 @@ function contextChangePriority( event, Priority )
}
}
function changeToolTipTextForToDo( event )
{
var toDoItem = getToDoFromEvent( event );
var toolTip = document.getElementById( "taskTreeTooltip" );
while( toolTip.hasChildNodes() )
{
toolTip.removeChild( toolTip.firstChild );
}
var holderBox = getPreviewForTask( toDoItem );
if( holderBox ) {
toolTip.appendChild( holderBox );
return true;
} else {
return false;
}
}
function changeContextMenuForToDo( event )
{
if (event.target.id != "taskitem-context-menu")

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

@ -407,11 +407,11 @@
<!-- tooltips to show cropped text behave as a titletip: don't hide until mouse moved away -->
<tooltip id="eventTreeTooltip"
onpopupshowing="return changeToolTipTextForEvent( event );"
onpopupshowing="return onMouseOverEventTree( this, event )"
noautohide="true"/>
<tooltip id="taskTreeTooltip"
onpopupshowing="return changeToolTipTextForToDo( event );"
onpopupshowing="return onMouseOverTaskTree( this, event )"
noautohide="true"/>
<tooltip id="gridOccurrenceTooltip"