bug 7797: middle menu item - if first row description is longer than max length (30 characters), add "...." at the end to imply there is more.

This commit is contained in:
Jessica Wang 2011-01-03 13:58:15 -08:00
parent a3fccef7be
commit d495be0546
2 changed files with 12 additions and 3 deletions

View File

@ -75,7 +75,7 @@ function eventToMidmenu(jsonObj, $midmenuItem1) {
else if(jsonObj.level == "WARN")
$iconContainer.find("#icon").attr("src", "images/midmenuicon_events_warning.png");
$midmenuItem1.find("#first_row").text(fromdb(jsonObj.description).substring(0,25));
$midmenuItem1.find("#first_row").text(getMidmenuItemFirstRow(jsonObj.description));
$midmenuItem1.find("#second_row").text(fromdb(jsonObj.type).substring(0,25));
}

View File

@ -1111,8 +1111,17 @@ function drawBarChart($capacity, percentused) { //percentused == "0.01%" (having
else if (percentusedFloat > 0.8 )
$capacity.find("#bar_chart").removeClass().addClass("db_barbox high").css("width", percentused);
}
var midmenuItemFirstRowMaxLength = 30;
function getMidmenuItemFirstRow(text) {
var text2 = fromdb(text);
var text3;
if(text2.length > midmenuItemFirstRowMaxLength)
text3 = fromdb(text2).substring(0, (midmenuItemFirstRowMaxLength-4)) + "....";
else
text3 = fromdb(text2).substring(0, midmenuItemFirstRowMaxLength);
return text3;
}