mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
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:
parent
a3fccef7be
commit
d495be0546
@ -75,7 +75,7 @@ function eventToMidmenu(jsonObj, $midmenuItem1) {
|
|||||||
else if(jsonObj.level == "WARN")
|
else if(jsonObj.level == "WARN")
|
||||||
$iconContainer.find("#icon").attr("src", "images/midmenuicon_events_warning.png");
|
$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));
|
$midmenuItem1.find("#second_row").text(fromdb(jsonObj.type).substring(0,25));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1112,7 +1112,16 @@ function drawBarChart($capacity, percentused) { //percentused == "0.01%" (having
|
|||||||
$capacity.find("#bar_chart").removeClass().addClass("db_barbox high").css("width", percentused);
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user