Skip to content

Commit 0140d25

Browse files
committed
Toggle link positioning for truncation directive
Fixes #1277
1 parent fb5ff0b commit 0140d25

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

Diff for: app/styles/_core.less

+10
Original file line numberDiff line numberDiff line change
@@ -1286,3 +1286,13 @@ copy-to-clipboard .input-group.limit-width {
12861286
width: 100%;
12871287
}
12881288
}
1289+
1290+
// Within truncation directive controls spacing between content and toggle link
1291+
.truncation-block {
1292+
margin-right: 10px;
1293+
}
1294+
1295+
.truncation-collapse-link {
1296+
margin-left: 10px;
1297+
white-space: nowrap;
1298+
}

Diff for: app/views/directives/truncate-long-text.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<span ng-if="!truncated" ng-bind-html="content | highlightKeywords : keywords" class="truncated-content"></span>
22
<span ng-if="truncated">
33
<span ng-if="!toggles.expanded">
4-
<span ng-attr-title="{{content}}">
4+
<span ng-attr-title="{{content}}" class="truncation-block">
55
<span ng-bind-html="truncatedContent | highlightKeywords : keywords" class="truncated-content"></span>&hellip;
66
</span>
7-
<a ng-if="expandable" href="" ng-click="toggles.expanded = true" style="margin-left: 5px; white-space: nowrap;">See all</a>
7+
<a ng-if="expandable" href="" ng-click="toggles.expanded = true" class="nowrap">See All</a>
88
</span>
99
<span ng-if="toggles.expanded">
1010
<div ng-if="prettifyJson" class="well">
11-
<span class="pull-right" style="margin-top: -10px;"><a href="" ng-click="toggles.expanded = false">Collapse</a></span>
11+
<span class="pull-right" style="margin-top: -10px;"><a href="" ng-click="toggles.expanded = false" class="truncation-collapse-link">Collapse</a></span>
1212
<span ng-bind-html="content | prettifyJSON | highlightKeywords : keywords" class="pretty-json truncated-content"></span>
1313
</div>
1414
<span ng-if="!prettifyJson">
15-
<span class="pull-right"><a href="" ng-click="toggles.expanded = false">Collapse</a></span>
15+
<span class="pull-right"><a href="" ng-click="toggles.expanded = false" class="truncation-collapse-link">Collapse</a></span>
1616
<span ng-bind-html="content | highlightKeywords : keywords" class="truncated-content"></span>
1717
</span>
1818
</span>

Diff for: dist/scripts/templates.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -8945,18 +8945,18 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
89458945
"<span ng-if=\"!truncated\" ng-bind-html=\"content | highlightKeywords : keywords\" class=\"truncated-content\"></span>\n" +
89468946
"<span ng-if=\"truncated\">\n" +
89478947
"<span ng-if=\"!toggles.expanded\">\n" +
8948-
"<span ng-attr-title=\"{{content}}\">\n" +
8948+
"<span ng-attr-title=\"{{content}}\" class=\"truncation-block\">\n" +
89498949
"<span ng-bind-html=\"truncatedContent | highlightKeywords : keywords\" class=\"truncated-content\"></span>&hellip;\n" +
89508950
"</span>\n" +
8951-
"<a ng-if=\"expandable\" href=\"\" ng-click=\"toggles.expanded = true\" style=\"margin-left: 5px; white-space: nowrap\">See all</a>\n" +
8951+
"<a ng-if=\"expandable\" href=\"\" ng-click=\"toggles.expanded = true\" class=\"nowrap\">See All</a>\n" +
89528952
"</span>\n" +
89538953
"<span ng-if=\"toggles.expanded\">\n" +
89548954
"<div ng-if=\"prettifyJson\" class=\"well\">\n" +
8955-
"<span class=\"pull-right\" style=\"margin-top: -10px\"><a href=\"\" ng-click=\"toggles.expanded = false\">Collapse</a></span>\n" +
8955+
"<span class=\"pull-right\" style=\"margin-top: -10px\"><a href=\"\" ng-click=\"toggles.expanded = false\" class=\"truncation-collapse-link\">Collapse</a></span>\n" +
89568956
"<span ng-bind-html=\"content | prettifyJSON | highlightKeywords : keywords\" class=\"pretty-json truncated-content\"></span>\n" +
89578957
"</div>\n" +
89588958
"<span ng-if=\"!prettifyJson\">\n" +
8959-
"<span class=\"pull-right\"><a href=\"\" ng-click=\"toggles.expanded = false\">Collapse</a></span>\n" +
8959+
"<span class=\"pull-right\"><a href=\"\" ng-click=\"toggles.expanded = false\" class=\"truncation-collapse-link\">Collapse</a></span>\n" +
89608960
"<span ng-bind-html=\"content | highlightKeywords : keywords\" class=\"truncated-content\"></span>\n" +
89618961
"</span>\n" +
89628962
"</span>\n" +

Diff for: dist/styles/main.css

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
div.code,pre,textarea{overflow:auto}
22
.text-left,caption,th{text-align:left}
33
.bootstrap-select.btn-group .dropdown-menu li a,.datepicker table{-ms-user-select:none;-webkit-user-select:none;-moz-user-select:none}
4-
.c3 svg,html{-webkit-tap-highlight-color:transparent}
54
.list-view-pf-top-align .list-view-pf-actions,.list-view-pf-top-align .list-view-pf-checkbox{align-self:flex-start}
65
@font-face{font-family:"Open Sans";font-style:normal;font-weight:300;src:url(../styles/fonts/OpenSans-Light-webfont.eot);src:local("Open Sans Light"),local("OpenSans-Light"),url(../styles/fonts/OpenSans-Light-webfont.eot?#iefix) format("embedded-opentype"),url(../styles/fonts/OpenSans-Light-webfont.woff2) format("woff2"),url(../styles/fonts/OpenSans-Light-webfont.woff) format("woff"),url(../styles/fonts/OpenSans-Light-webfont.ttf) format("truetype"),url(../styles/fonts/OpenSans-Light-webfont.svg#OpenSans) format("svg")}
76
@font-face{font-family:"Open Sans";font-style:normal;font-weight:400;src:url(../styles/fonts/OpenSans-Regular-webfont.eot);src:local("Open Sans"),local("OpenSans"),url(../styles/fonts/OpenSans-Regular-webfont.eot?#iefix) format("embedded-opentype"),url(../styles/fonts/OpenSans-Regular-webfont.woff2) format("woff2"),url(../styles/fonts/OpenSans-Regular-webfont.woff) format("woff"),url(../styles/fonts/OpenSans-Regular-webfont.ttf) format("truetype"),url(../styles/fonts/OpenSans-Regular-webfont.svg#OpenSans) format("svg")}
@@ -331,7 +330,7 @@ h2,h3{page-break-after:avoid}
331330
.glyphicon-menu-down:before{content:"\e259"}
332331
.glyphicon-menu-up:before{content:"\e260"}
333332
*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
334-
html{font-size:10px}
333+
html{font-size:10px;-webkit-tap-highlight-color:transparent}
335334
body{font-family:"Open Sans",Helvetica,Arial,sans-serif;font-size:13px;line-height:1.66666667;color:#363636}
336335
button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}
337336
a{color:#0088ce;text-decoration:none}
@@ -2455,7 +2454,7 @@ select.bs-select-hidden,select.selectpicker{display:none!important}
24552454
.bs-searchbox .form-control{margin-bottom:0;width:100%;float:none}
24562455
.bootstrap-switch{display:inline-block;direction:ltr;cursor:pointer;border-radius:1px;border:1px solid #bbb;position:relative;text-align:left;overflow:hidden;line-height:8px;z-index:0;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}
24572456
.bootstrap-switch .bootstrap-switch-container{display:inline-block;top:0;border-radius:1px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}
2458-
.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:inline-block!important;height:100%;padding:2px 6px;font-size:13px;line-height:21px}
2457+
.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on,.bootstrap-switch .bootstrap-switch-label{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;display:table-cell;vertical-align:middle;padding:2px 6px;font-size:13px;line-height:21px}
24592458
.ie9.layout-pf-alt-fixed .nav-pf-vertical-alt,.ie9.layout-pf-fixed .nav-pf-secondary-nav,.ie9.layout-pf-fixed .nav-pf-tertiary-nav,.ie9.layout-pf-fixed .nav-pf-vertical,.list-group-item-header{box-sizing:content-box}
24602459
.bootstrap-switch .bootstrap-switch-handle-off,.bootstrap-switch .bootstrap-switch-handle-on{text-align:center;z-index:1}
24612460
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary{color:#fff;background:#0088ce}
@@ -2465,9 +2464,10 @@ select.bs-select-hidden,select.selectpicker{display:none!important}
24652464
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger{color:#fff;background:#a30000}
24662465
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default,.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default{color:#000}
24672466
.bootstrap-switch .bootstrap-switch-label{text-align:center;margin-top:-1px;margin-bottom:-1px;color:#4d5258}
2467+
.bootstrap-switch span::before{content:"\200b"}
24682468
.bootstrap-switch .bootstrap-switch-handle-on{border-bottom-left-radius:0px;border-top-left-radius:0px}
24692469
.bootstrap-switch .bootstrap-switch-handle-off{border-bottom-right-radius:0px;border-top-right-radius:0px}
2470-
.bootstrap-switch input[type=radio],.bootstrap-switch input[type=checkbox]{position:absolute!important;top:0;left:0;margin:0;z-index:-1;opacity:0;filter:alpha(opacity=0)}
2470+
.bootstrap-switch input[type=radio],.bootstrap-switch input[type=checkbox]{position:absolute!important;top:0;left:0;margin:0;z-index:-1;opacity:0;filter:alpha(opacity=0);visibility:hidden}
24712471
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label{padding:1px 5px;font-size:11px;line-height:1.5}
24722472
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label{padding:2px 6px;font-size:11px;line-height:1.5}
24732473
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label{padding:2px 10px;font-size:15px;line-height:1.3333333}
@@ -2485,7 +2485,7 @@ select.bs-select-hidden,select.selectpicker{display:none!important}
24852485
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-up{border-radius:0 4px 0 0}
24862486
.bootstrap-touchspin .input-group-btn-vertical .bootstrap-touchspin-down{margin-top:-2px;border-radius:0 0 4px}
24872487
.bootstrap-touchspin .input-group-btn-vertical i{position:absolute;font-weight:400}
2488-
.c3 svg{font:10px sans-serif}
2488+
.c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}
24892489
.c3 line,.c3 path{fill:none;stroke:#000}
24902490
.c3 text{user-select:none}
24912491
.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}
@@ -4134,6 +4134,8 @@ copy-to-clipboard .input-group.limit-width{max-width:300px}
41344134
.tech-preview-header{justify-content:space-between}
41354135
@media (max-width:479px){.col-xxs-12{width:100%}
41364136
}
4137+
.truncation-block{margin-right:10px}
4138+
.truncation-collapse-link{margin-left:10px;white-space:nowrap}
41374139
.data-toolbar{padding:5px 0}
41384140
.data-toolbar.other-resources-toolbar .data-toolbar-dropdown{min-width:210px}
41394141
.data-toolbar .checkbox{margin-bottom:0;margin-top:10px}

0 commit comments

Comments
 (0)