Skip to content

Commit 2a971d7

Browse files
committed
Detail view UI: Support for text action buttons
Currently, only icons are rendered on detail view actions. This change adds support for showing a text label next to specified actions, which has a button appearance. This is to allow certain actions to be more visible, in the case where an icon isn't clear enough. To make an action have a text label, add a 'textLabel' attribute to the action properties: editVpc: { label: 'Edit VPC', // textLabel property textLabel: 'label.configure', action: { ... } }
1 parent 9b039d9 commit 2a971d7

2 files changed

Lines changed: 39 additions & 2 deletions

File tree

ui/css/cloudstack3.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,35 @@ div.detail-group.actions td {
16711671
height: 26px;
16721672
}
16731673

1674+
.detail-group table td.detail-actions .action.text {
1675+
padding: 4px 6px 4px 7px;
1676+
cursor: pointer;
1677+
display: inline-block;
1678+
border: 1px solid #C2C2C2;
1679+
/*+border-radius:4px;*/
1680+
-moz-border-radius: 4px;
1681+
-webkit-border-radius: 4px;
1682+
-khtml-border-radius: 4px;
1683+
border-radius: 4px;
1684+
background: url(../images/bg-gradients.png) repeat-x 0px -83px;
1685+
}
1686+
1687+
.detail-group table td.detail-actions .action.text .label {
1688+
font-size: 12px;
1689+
/*+placement:shift -1px 8px;*/
1690+
position: relative;
1691+
left: -1px;
1692+
top: 8px;
1693+
}
1694+
1695+
.detail-group table td.detail-actions .action.text:hover {
1696+
/*+box-shadow:inset 0px 1px 3px #171717;*/
1697+
-moz-box-shadow: inset 0px 1px 3px #171717;
1698+
-webkit-box-shadow: inset 0px 1px 3px #171717;
1699+
-o-box-shadow: inset 0px 1px 3px #171717;
1700+
box-shadow: inset 0px 1px 3px #171717;
1701+
}
1702+
16741703
.detail-group table td.detail-actions div.buttons {
16751704
/*+placement:shift 6px 0px;*/
16761705
position: relative;

ui/scripts/ui/widgets/detailView.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,14 @@
641641
)
642642
.appendTo($action);
643643

644+
if (value.textLabel) {
645+
$action
646+
.addClass('text')
647+
.prepend(
648+
$('<span>').addClass('label').html(_l(value.textLabel))
649+
);
650+
}
651+
644652
return true;
645653
});
646654

@@ -1091,8 +1099,8 @@
10911099
}
10921100

10931101
// Detail action
1094-
if ($target.closest('div.detail-view [detail-action]').size()) {
1095-
var $action = $target.closest('div.detail-view [detail-action]');
1102+
if ($target.closest('div.detail-view [detail-action], div.detail-view .action.text').size()) {
1103+
var $action = $target.closest('.action').find('[detail-action]');
10961104
var actionName = $action.attr('detail-action');
10971105
var actionCallback = $action.data('detail-view-action-callback');
10981106
var detailViewArgs = $action.closest('div.detail-view').data('view-args');

0 commit comments

Comments
 (0)