diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 9789eda08b1..bcb82d3aba1 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -1835,6 +1835,58 @@ div.list-view td.state.off span { float: left; width: 245px; } +.detail-group .main-groups table td.value > span.copypasteenabledvalue { + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + +.detail-group .main-groups table td.value > .copypasteactive { + display: auto; + white-space: nowrap; + overflow: none; +} + +div.copypasteicon { + background: url("../images/sprites.png") no-repeat scroll -271px -65px; + float: left; + height: 21px; + margin-left: 6px; + margin-top: 0px; + width: 18px; +} + +div.copypasteicon:hover { + background: url("../images/sprites.png") no-repeat scroll -271px -646px; +} + +.detail-group .main-groups table td.value > span.copypasteenabledvalue { + text-overflow: ellipsis; + -o-text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + +.detail-group .main-groups table td.value > .copypasteactive { + display: auto; + white-space: nowrap; + overflow: none; +} + +div.copypasteicon { + background: url("../images/sprites.png") no-repeat scroll -271px -65px; + float: left; + height: 21px; + margin-left: 6px; + margin-top: 0px; + width: 18px; +} + +div.copypasteicon:hover { + background: url("../images/sprites.png") no-repeat scroll -271px -646px; +} + .detail-group .main-groups table td.value > span select { width: 100% !important; diff --git a/ui/images/sprites.png b/ui/images/sprites.png old mode 100644 new mode 100755 index ee640476efa..1a6eaa577f2 Binary files a/ui/images/sprites.png and b/ui/images/sprites.png differ diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index aff780ef480..2b83f1a5829 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -1375,10 +1375,12 @@ label: 'label.state' }, apikey: { - label: 'label.api.key' + label: 'label.api.key', + isCopyPaste: true }, secretkey: { - label: 'label.secret.key' + label: 'label.secret.key', + isCopyPaste: true }, account: { label: 'label.account.name' diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js index 4c5aeea6bd6..e0838788b2e 100644 --- a/ui/scripts/ui/widgets/detailView.js +++ b/ui/scripts/ui/widgets/detailView.js @@ -456,6 +456,13 @@ tooltip: '.tooltip-box' }); + var removeCopyPasteIcons = function() { + $detailView.find('.copypasteactive').removeClass('copypasteactive').addClass('copypasteenabledvalue'); + $detailView.find('td.value .copypasteicon').hide(); + }; + + removeCopyPasteIcons(); + var convertInputs = function($inputs) { // Save and turn back into labels $inputs.each(function() { @@ -606,11 +613,12 @@ return false; } } + restoreCopyPasteIcons(); applyEdits($inputs, $editButton); } else { // Cancel + restoreCopyPasteIcons(); cancelEdits($inputs, $editButton); } - return true; }); @@ -625,6 +633,9 @@ tooltip: '.tooltip-box' }); + var restoreCopyPasteIcons = function() { + $detailView.find('td.value .copypasteicon').show(); + }; $detailView.find('td.value span').each(function() { var name = $(this).closest('tr').data('detail-view-field'); @@ -931,7 +942,6 @@ $(fields).each(function() { var fieldGroup = this; - var $detailTable = $('
').appendTo( $('