Fixing bug 197044, event and tasks description should be displayed on multiple lines.

git-svn-id: svn://10.0.0.236/trunk@139467 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mikep%oeone.com 2003-03-14 20:35:47 +00:00
parent 23f69c2b5a
commit 0a74efbe79
2 changed files with 32 additions and 13 deletions

View File

@ -954,14 +954,21 @@ function getPreviewTextForRepeatingEvent( calendarEventDisplay )
if (calendarEventDisplay.event.description)
{
var DescriptionHtml = document.createElement( "description" );
var Description = calendarEventDisplay.event.description;
if( Description.length > 53 )
Description = Description.substr( 0, 50 )+"...";
var DescriptionText = document.createTextNode( "Description: "+Description );
DescriptionHtml.appendChild( DescriptionText );
HolderBox.appendChild( DescriptionHtml );
var Description = "Description: "+calendarEventDisplay.event.description;
var lines = Description.split("\n");
var nbmaxlines = 5 ;
var nblines = lines.length ;
if( nblines > nbmaxlines ) {
var nblines = nbmaxlines ;
lines[ nblines - 1 ] = "..." ;
}
for (var i = 0; i < nblines; i++) {
var DescriptionHtml = document.createElement("description");
var DescriptionText = document.createTextNode(lines[i]);
DescriptionHtml.appendChild(DescriptionText);
HolderBox.appendChild(DescriptionHtml);
}
}
return ( HolderBox );

View File

@ -172,6 +172,8 @@ function modifyToDoCommand( event )
if( ThisToDo )
editToDo( ThisToDo );
else
newToDoCommand();
}
/**
@ -323,7 +325,7 @@ var toDoTreeView =
props.AppendElement(aserv.getAtom(ToDoProgressAtom(calendarToDo)));
},
getColumnProperties : function(){return false;},
// By getCellProperties, the properties defined with
// By getRowProperties, the properties defined with
// treechildren:-moz-tree-row in CSS are used.
// It is used here to color the background of a selected
// ToDo task with a color
@ -611,10 +613,20 @@ function changeToolTipTextForToDo( event )
if (toDoItem.description)
{
var DescriptionHtml = document.createElement( "description" );
var DescriptionText = document.createTextNode( "Description: "+toDoItem.description );
DescriptionHtml.appendChild( DescriptionText );
HolderBox.appendChild( DescriptionHtml );
var text = "Description: "+toDoItem.description ;
var lines = text.split("\n");
var nbmaxlines = 5 ;
var nblines = lines.length ;
if( nblines > nbmaxlines ) {
var nblines = nbmaxlines ;
lines[ nblines - 1 ] = "..." ;
}
for (var i = 0; i < nblines; i++) {
var DescriptionHtml = document.createElement("description");
var DescriptionText = document.createTextNode(lines[i]);
DescriptionHtml.appendChild(DescriptionText);
HolderBox.appendChild(DescriptionHtml);
}
}
Html.appendChild( HolderBox );