Skip to content

Commit 7e4407d

Browse files
committed
CLOUDSTACK-5532: Tag UI: Truncate long tag key/value
1 parent fa2f18d commit 7e4407d

2 files changed

Lines changed: 35 additions & 2 deletions

File tree

ui/css/cloudstack3.css

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10296,6 +10296,11 @@ div.container div.panel div#details-tab-addloadBalancer.detail-group div.loadBal
1029610296
color: #000000;
1029710297
}
1029810298

10299+
.tagger ul li span.label span.value {
10300+
max-width: 100px;
10301+
overflow: hidden;
10302+
}
10303+
1029910304
.tagger ul li span.label {
1030010305
font-size: 10px;
1030110306
position: relative;
@@ -10307,11 +10312,35 @@ div.container div.panel div#details-tab-addloadBalancer.detail-group div.loadBal
1030710312
left: 6px;
1030810313
}
1030910314

10315+
.tagger ul li span.label > span {
10316+
float: left;
10317+
display: block;
10318+
margin-top: 2px;
10319+
}
10320+
10321+
.tagger ul li span.label > span.key {
10322+
font-weight: bold;
10323+
max-width: 134px;
10324+
overflow: hidden;
10325+
white-space: nowrap;
10326+
text-overflow: ellipsis;
10327+
margin-left: 15px;
10328+
margin-right: 5px;
10329+
}
10330+
10331+
.tagger ul li span.label > span.value {
10332+
max-width: 160px;
10333+
overflow: hidden;
10334+
white-space: nowrap;
10335+
text-overflow: ellipsis;
10336+
margin-left: 6px;
10337+
}
10338+
1031010339
.tagger ul li span.remove {
1031110340
width: 15px !important;
1031210341
overflow: hidden !important;
1031310342
height: 11px !important;
10314-
background: #DFDFDF url(../images/sprites.png) no-repeat -596px -1183px;
10343+
background: #DFDFDF;
1031510344
display: block;
1031610345
top: 0px !important;
1031710346
left: -3px !important;

ui/scripts/ui/widgets/tagger.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,13 @@
9595
},
9696
tagItem: function(title, onRemove, data) {
9797
var $li = $('<li>');
98-
var $label = $('<span>').addClass('label').html(_s(title));
98+
var $label = $('<span>').addClass('label');
9999
var $remove = $('<span>').addClass('remove').html('X');
100+
var $key = $('<span>').addClass('key').html(_s(data.key));
101+
var $value = $('<span>').addClass('value').html(_s(data.value));
100102

103+
$label.append($key, '<span>=</span>', $value);
104+
$label.attr('title', title);
101105
$remove.click(function() {
102106
if (onRemove) onRemove($li, data);
103107
});

0 commit comments

Comments
 (0)