Skip to content

Commit 8eaa96b

Browse files
committed
black magic fixes to the lightbox
1 parent cb095ba commit 8eaa96b

3 files changed

Lines changed: 53 additions & 28 deletions

File tree

‎src/skins/vector/css/atoms/ImageView.css‎

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ limitations under the License.
3131
-webkit-box-ordinal-group: 1;
3232
order: 1;
3333
-webkit-flex: 1;
34-
flex: 1 1 0;
34+
flex: 1 1 10%;
3535
min-width: 60px;
36+
/*
37+
background-color: #080;
38+
height: 20px;
39+
*/
3640
}
3741

3842
.mx_ImageView_content {
@@ -41,8 +45,8 @@ limitations under the License.
4145
/* min-width hack needed for FF */
4246
min-width: 0px;
4347
height: 90%;
44-
-webkit-flex: 5;
45-
flex: 5 5 0;
48+
-webkit-flex: 100;
49+
flex: 100 100 0;
4650

4751
display: -webkit-flex;
4852
display: flex;
@@ -55,21 +59,28 @@ limitations under the License.
5559
.mx_ImageView_content img {
5660
max-width: 100%;
5761
/* can't use max-height as it interacts badly with flex on Chrome and doesn't relayout properly until you refresh */
58-
height: 100%;
62+
max-height: 100%;
5963
/* object-fit hack needed for Chrome */
6064
object-fit: contain;
65+
background-image: url('img/trans.png');
66+
}
67+
68+
.mx_ImageView_labelWrapper {
69+
position: absolute;
70+
top: 0px;
71+
height: 100%;
72+
overflow: auto;
6173
}
6274

6375
.mx_ImageView_label {
6476
text-align: left;
65-
display: inline-block;
66-
width: 300px;
67-
height: 300px;
68-
top: 50%;
69-
margin-top: -150px;
70-
position: absolute;
77+
display: flex;
78+
justify-content: center;
79+
flex-direction: column;
80+
padding-left: 60px;
81+
padding-right: 60px;
82+
min-height: 100%;
7183
color: #fff;
72-
padding: 60px;
7384
}
7485

7586
.mx_ImageView_name {
@@ -83,7 +94,7 @@ limitations under the License.
8394
}
8495

8596
.mx_ImageView_download {
86-
display: inline-block;
97+
display: table;
8798
margin-top: 28px;
8899
border-radius: 5px;
89100
background-color: #454545;
@@ -100,10 +111,18 @@ limitations under the License.
100111
cursor: pointer;
101112
}
102113

114+
.mx_ImageView_shim {
115+
height: 30px;
116+
}
117+
103118
.mx_ImageView_rhs {
104119
-webkit-box-ordinal-group: 3;
105120
order: 3;
106121
-webkit-flex: 1;
107-
flex: 1 1 0;
122+
flex: 1 1 10%;
108123
min-width: 300px;
124+
/*
125+
background-color: #800;
126+
height: 20px;
127+
*/
109128
}

‎src/skins/vector/img/trans.png‎

959 Bytes
Loading

‎src/skins/vector/views/atoms/ImageView.js‎

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,27 @@ module.exports = React.createClass({
7979
</div>
8080
<div className="mx_ImageView_content">
8181
<img src={this.props.src} style={style}/>
82-
<div className="mx_ImageView_label">
83-
<div className="mx_ImageView_name">
84-
{ this.props.mxEvent.getContent().body }
85-
</div>
86-
<div className="mx_ImageView_metadata">
87-
Uploaded on { DateUtils.formatDate(new Date(this.props.mxEvent.getTs())) } by { this.props.mxEvent.getSender() }
88-
</div>
89-
<div className="mx_ImageView_download">
90-
Download this file ({ filesize(this.props.mxEvent.getContent().info.size) })
91-
</div>
92-
<div className="mx_ImageView_button">
93-
View full screen
94-
</div>
95-
<div className="mx_ImageView_button">
96-
Redact
82+
<div className="mx_ImageView_labelWrapper">
83+
<div className="mx_ImageView_label">
84+
<div className="mx_ImageView_shim">
85+
</div>
86+
<div className="mx_ImageView_name">
87+
{ this.props.mxEvent.getContent().body }
88+
</div>
89+
<div className="mx_ImageView_metadata">
90+
Uploaded on { DateUtils.formatDate(new Date(this.props.mxEvent.getTs())) } by { this.props.mxEvent.getSender() }
91+
</div>
92+
<div className="mx_ImageView_download">
93+
Download this file ({ filesize(this.props.mxEvent.getContent().info.size) })
94+
</div>
95+
<div className="mx_ImageView_button">
96+
View full screen
97+
</div>
98+
<div className="mx_ImageView_button">
99+
Redact
100+
</div>
101+
<div className="mx_ImageView_shim">
102+
</div>
97103
</div>
98104
</div>
99105
</div>

0 commit comments

Comments
 (0)