Fixing problem with tooltips showing when not over anything in trees.

git-svn-id: svn://10.0.0.236/trunk@128156 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mikep%oeone.com
2002-08-26 20:53:52 +00:00
parent b1ea054b38
commit 2810f76a83
4 changed files with 28 additions and 122 deletions

View File

@@ -78,7 +78,7 @@ h1 {
<td id="mozver">
<h1>
<a id="mozlink" href="http://www.mozilla.org/projects/calendar/" target="_new">Mozilla Calendar 2002082610-cal</a>
<a id="mozlink" href="http://www.mozilla.org/projects/calendar/" target="_new">Mozilla Calendar 2002082615-cal</a>
</h1>
<script type="application/x-javascript">
// using try..catch to handle empty useragents and other cases where the regex fails to apply

View File

@@ -99,7 +99,7 @@ var gHeaderDateItemArray = null;
var gClockId;
// Show event details on mouseover
var showEventDetails = true;
var showTooltip = true;
// DAY VIEW VARIABLES
var kDayViewHourHeight = 50;
@@ -659,6 +659,8 @@ function changeToolTipTextForToDo( event )
if( toDoItem )
{
showTooltip = true; //needed to show the tooltip.
if (toDoItem.title)
{
var TitleHtml = document.createElement( "description" );
@@ -688,7 +690,11 @@ function changeToolTipTextForToDo( event )
}
Html.appendChild( HolderBox );
}
}
else
{
showTooltip = false; //Don't show the tooltip
}
}
function changeToolTipTextForEvent( event )
@@ -703,7 +709,12 @@ function changeToolTipTextForEvent( event )
}
if( !thisEvent )
return( false );
{
showTooltip = false;
return;
}
showTooltip = true;
var HolderBox = getPreviewText( thisEvent );
@@ -845,5 +856,10 @@ function print()
function publishCalendarData()
{
var calendarString = eventArrayToICalString( gCalendarWindow.EventSelection.selectedEvents );
calendarPublish(calendarString, "ftp://home.planet.com/", "CalendarDataFile.ics", "ajb", "*****", "text/calendar");
calendarPublish(calendarString, Server, FilePath, UserName, Password, "text/calendar");
}
function checkTooltip()
{
return( showTooltip );
}

View File

@@ -176,9 +176,6 @@
<script type="application/x-javascript" src="chrome://calendar/content/pref/rootCalendarPref.js"/>
<!-- Pop up menus -->
<tooltip id="savetip"/>
<!-- GENERAL CONTEXT MENU -->
<popup id="context-menu">
<menuitem label="&calendar.context.newevent.label;" accesskey="&calendar.context.newevent.accesskey;" observes="new_command"/>
@@ -247,12 +244,9 @@
<toolbox id="calendar-toolbox" class="toolbox-top" deferattached="true">
<!-- Menu -->
<menubar id="main-menubar" persist="collapsed"
grippytooltip="aTooltip" grippytooltiptext="&menuBar.tooltip;"/>
<menubar id="main-menubar" persist="collapsed"/>
<toolbar class="toolbar-primary chromeclass-toolbar" id="calendar-bar" persist="collapsed"
grippytooltip="aTooltip" grippytooltiptext="&navigationToolbar.tooltip;"
tbalign="stretch">
<toolbar class="toolbar-primary chromeclass-toolbar" id="calendar-bar" persist="collapsed" tbalign="stretch">
<!--<toolbarbutton class="toolbarbutton-1" id="calendar-new-task-button" label="&calendar.newtask.button.label;" tooltiptext="&calendar.newtask.button.tooltip;" observes="new_todo_command"/>-->
<toolbarbutton class="toolbarbutton-1" id="calendar-new-event-button" label="&calendar.newevent.button.label;" tooltiptext="&calendar.newevent.button.tooltip;" observes="new_command"/>
<toolbarbutton class="toolbarbutton-1" id="calendar-edit-event-button" label="&calendar.edit.button.label;" tooltiptext="&calendar.edit.button.tooltip;" observes="modify_command"/>
@@ -272,7 +266,7 @@
</toolbar>
</toolbox>
<tooltip id="savetip"/>
<tooltip id="savetip" onpopupshowing="return( checkTooltip() );"/>
<!-- V I S I B L E C O N T E N T -->
@@ -306,7 +300,7 @@
<checkbox id="only-completed-checkbox" label="&calendar.unifinder.hidecompletedtodos.label;" oncommand="toDoUnifinderRefesh( event )" persist="checked"/>
</box>
<tree tooltip="savetip" id="unifinder-todo-tree" flex="1" enableColumnDrag="false">
<tree id="unifinder-todo-tree" flex="1" enableColumnDrag="false">
<treecols id="unifinder-todo-tree-cols">
<treecol id="unifinder-todo-tree-col-completed"
persist="hidden ordinal width" minwidth="18" maxwidth="18" width="18"
@@ -350,7 +344,7 @@
flex="1" label="&calendar.unifinder.tree.categories.label;"/>
</treecols>
<treechildren onmousemove="changeToolTipTextForToDo( event )"
<treechildren tooltip="savetip" onmousemove="changeToolTipTextForToDo( event )"
onclick="unifinderClickToDo( event )"
ondblclick="unifinderDoubleClickToDo( event )"
onmousedown="unifinderMouseDownToDo( event )"
@@ -385,7 +379,7 @@
</menulist>
</box>
<tree tooltip="savetip" id="unifinder-search-results-listbox" flex="1" seltype="multiple" enableColumnDrag="false">
<tree id="unifinder-search-results-listbox" flex="1" seltype="multiple" enableColumnDrag="false">
<treecols id="unifinder-search-results-tree-cols">
<treecol id="unifinder-search-results-tree-col-title"
persist="hidden ordinal width" flex="1"
@@ -407,7 +401,7 @@
flex="1" label="&calendar.unifinder.tree.categories.label;"/>
</treecols>
<treechildren onmousemove="changeToolTipTextForEvent( event )"
<treechildren tooltip="savetip" onmousemove="changeToolTipTextForEvent( event )" onpopupshowing="return( false );"
onclick="unifinderClickEvent( event )"
onkeypress="if (event.keyCode == 13) unifinderEditCommand();"
ondragover="return( false );"

View File

@@ -581,110 +581,6 @@ function refreshEventTree( eventArray )
}
}
/* This function is not used */
function refreshEventTreeOld( eventArray )
{
// get the old tree children item and remove it
var oldTreeChildren = document.getElementById( UnifinderTreeName );
while( oldTreeChildren.hasChildNodes() )
oldTreeChildren.removeChild( oldTreeChildren.lastChild );
// add: tree item, row, cell, box and text items for every event
for( var index = 0; index < eventArray.length; ++index )
{
var calendarEvent = eventArray[ index ];
// make the items
var treeItem = document.createElement( "listitem" );
treeItem.setAttribute( "id", "search-unifinder-treeitem-"+calendarEvent.id );
treeItem.event = calendarEvent;
treeItem.setAttribute( "onmouseover", "changeToolTipTextForEvent( event )" );
treeItem.setAttribute( "ondblclick" , "unifinderDoubleClickEvent(" + calendarEvent.id + ")" );
//treeItem.setAttribute( "onclick" , "unifinderClickEvent(" + calendarEvent.id + ")" );
var treeCell = document.createElement( "listcell" );
treeCell.setAttribute( "flex" , "1" );
treeCell.setAttribute( "crop", "right" );
var image = document.createElement( "image" );
image.setAttribute( "class", "unifinder-calendar-event-icon-class" );
if ( calendarEvent.alarm )
{
image.setAttribute( "alarm", "true" );
}
else if( calendarEvent.recur == true )
{
image.setAttribute( "recur", "true" );
}
var treeCellHBox = document.createElement( "hbox" );
treeCellHBox.setAttribute( "flex" , "1" );
treeCellHBox.setAttribute( "class", "unifinder-treecell-box-class" );
treeCellHBox.setAttribute( "crop", "right" );
treeCellHBox.setAttribute( "align", "center" );
var treeCellVBox = document.createElement( "vbox" );
treeCellVBox.setAttribute( "crop", "right" );
treeCellVBox.setAttribute( "flex", "1" );
var text1 = document.createElement( "label" );
text1.setAttribute( "crop", "right" );
var text2 = document.createElement( "label" );
text2.setAttribute( "crop", "right" );
// set up the display and behaviour of the tree items
// set the text of the two text items
text1.setAttribute( "value" , calendarEvent.title );
var eventStartDate = getNextOrPreviousRecurrence( calendarEvent );
var eventEndDate = new Date( calendarEvent.end.getTime() );
var startDate = formatUnifinderEventDate( eventStartDate );
var startTime = formatUnifinderEventTime( eventStartDate );
var endTime = formatUnifinderEventTime( eventEndDate );
if( calendarEvent.allDay )
{
text2.setAttribute( "value" , "All day on " + startDate + "" );
}
else
{
text2.setAttribute( "value" , startDate + " " + startTime + " - " + endTime );
}
// add the items
if ( calendarEvent.title )
{
treeCellVBox.appendChild( text1 );
}
treeCellVBox.appendChild( text2 );
treeCellHBox.appendChild( image );
treeCellHBox.appendChild( treeCellVBox );
treeCell.appendChild( treeCellHBox );
treeItem.appendChild( treeCell );
oldTreeChildren.appendChild( treeItem );
//you need this for when an event is added.
if( gCalendarWindow.EventSelection.isSelectedEvent( calendarEvent ) )
oldTreeChildren.addItemToSelection( treeItem );
}
}
function unifinderClearSearchCommand()
{
document.getElementById( "unifinder-search-field" ).value = "";