зеркало из https://github.com/mozilla/gecko-dev.git
Bug 295424 share code to set up tooltip content for unifinder, unifinderToDo.
patch by gekacheka@yahoo.com, r=mvl
This commit is contained in:
Родитель
2e75f4b46d
Коммит
016c8b0a3b
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче