Skip to content

Commit 4cd5fac

Browse files
committed
Layout improvement: auto scroll for list and panel-list when all columns do not fit.
1 parent d75bc1f commit 4cd5fac

File tree

4 files changed

+65
-45
lines changed

4 files changed

+65
-45
lines changed

js/view-many/many-list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Evol.ViewMany.List = Evol.View_Many.extend({
3232
link = (this.links!==false);
3333

3434
h+='<div class="evol-many-list">'+
35-
'<table class="table table-bordered'+(link?' table-hover':'')+'"><thead><tr>';
35+
'<div><table class="table table-bordered'+(link?' table-hover':'')+'"><thead><tr>';
3636
if(this.selectable){
3737
h+='<th class="list-td-sel">'+this._HTMLCheckbox('cbxAll')+'</th>';
3838
}
@@ -41,7 +41,7 @@ Evol.ViewMany.List = Evol.View_Many.extend({
4141
});
4242
h+='</tr></thead><tbody>'+
4343
this._HTMLbody(fields, pSize, this.uiModel.icon, 0, this.selectable)+
44-
'</tbody></table>'+
44+
'</tbody></table></div>'+
4545
this._HTMLpagination(0, pSize, models.length)+
4646
'<div class="evo-many-summary">'+this.pageSummary(this.pageIndex, pSize, models.length)+'</div>'+
4747
'</div>';

js/view-one/one.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ return Backbone.View.extend({
642642

643643
h.push('<div style="width:'+p.width+'%" class="evol-pnl" data-pid="'+p.id+'">',
644644
dom.panelBegin(p, this.style, true),
645-
'<table class="table" data-mid="'+(p.attribute || p.id)+'"><thead><tr>');
645+
'<div class="evo-plist"><table class="table" data-mid="'+(p.attribute || p.id)+'"><thead><tr>');
646646
_.each(p.elements, function (elem) {
647647
if(elem.type===fts.pix){
648648
h.push('<th class="evo-col-pix">');
@@ -656,7 +656,7 @@ return Backbone.View.extend({
656656
}
657657
h.push('</tr></thead><tbody>');
658658
this._renderPanelListBody(h, p, null, vMode);
659-
h.push('</tbody></table>',
659+
h.push('</tbody></table></div>',
660660
dom.panelEnd(),
661661
'</div>');
662662
return this;

less/many.less

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,52 @@
1111

1212
.evol-many-list{
1313

14-
overflow-x: auto;
14+
> div {
15+
overflow-x: auto;
16+
> .table {
1517

16-
> .table {
18+
margin-bottom: 0;
1719

18-
img {
19-
max-height: 60px;
20-
padding:0;
21-
}
22-
tr{
23-
transition: all 0.3s ease;
24-
}
25-
td{
26-
position: relative;
27-
}
28-
th {
29-
font-weight: @weight-label !important;
30-
background-color: @toolbar-background-color;
31-
32-
.glyphicon {
33-
display:none;
34-
position:absolute;
35-
opacity: .8;
36-
margin-left: 6px;
37-
background-color: white;
38-
cursor: pointer;
39-
width:22px;
40-
height: 22px;
20+
textarea{
21+
min-width:200px;
4122
}
4223

43-
&:hover .glyphicon {
44-
display: inline !important;
24+
img {
25+
max-height: 60px;
26+
padding:0;
27+
}
28+
tr{
29+
transition: all 0.3s ease;
4530
}
31+
td{
32+
position: relative;
33+
}
34+
th {
35+
font-weight: @weight-label !important;
36+
background-color: @toolbar-background-color;
37+
38+
.glyphicon {
39+
display:none;
40+
position:absolute;
41+
opacity: .8;
42+
margin-left: 6px;
43+
background-color: white;
44+
cursor: pointer;
45+
width:22px;
46+
height: 22px;
47+
}
48+
49+
&:hover .glyphicon {
50+
display: inline !important;
51+
}
4652

47-
}
48-
.evol-ellipsis{
49-
overflow: hidden;
50-
text-overflow: ellipsis;
51-
white-space: nowrap;
52-
max-width: 120px;
53+
}
54+
.evol-ellipsis{
55+
overflow: hidden;
56+
text-overflow: ellipsis;
57+
white-space: nowrap;
58+
max-width: 120px;
59+
}
5360
}
5461
}
5562

less/one.less

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
.flex-holder()
99
}
1010
.evol-pnl {
11+
padding-left:10px !important;
12+
.table {
13+
//margin-bottom: 0;
14+
img {
15+
max-height: 60px;
16+
padding:0;
17+
}
18+
}
1119
.flex-item();
1220
.table .evol-money{
1321
//TODO: better fix
@@ -22,14 +30,18 @@
2230
}
2331
}
2432
}
25-
.evol-pnl,
26-
.evol-pnl-lst{
27-
padding-left:10px !important;
28-
.table {
29-
img {
30-
max-height: 60px;
31-
padding:0;
32-
}
33+
34+
.evo-plist{
35+
overflow-x: auto;
36+
input[type="date"]{
37+
max-width: 160px;
38+
}
39+
input[type="text"],
40+
textarea{
41+
min-width: 120px;
42+
}
43+
.table{
44+
margin-bottom: 0;
3345
}
3446
}
3547

@@ -182,6 +194,7 @@ label{
182194
.evo-td-plusminus{
183195

184196
width:70px;
197+
min-width:70px;
185198

186199
> div{
187200
float:left;

0 commit comments

Comments
 (0)