Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve inline previews for links and images #524

Merged
merged 3 commits into from
Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions client/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@ kbd {

#chat .text {
flex: 1 1 auto;
overflow: hidden;
}

#loading a,
Expand Down Expand Up @@ -1103,8 +1104,9 @@ kbd {
color: #222;
font-size: 12px;
max-width: 100%;
padding: 6px 8px;
padding: 6px;
margin-top: 2px;
overflow: hidden;
}

#chat .toggle-content a {
Expand All @@ -1113,14 +1115,22 @@ kbd {

#chat .toggle-content img {
max-width: 100%;
max-height: 250px;
max-height: 128px;
display: block;
margin: 2px 0;
}

#chat .toggle-content .thumb {
max-height: 110px;
max-width: 210px;
float: left;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried flex instead of float?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not. Floats are very much designed for this kind of usage, and it works just fine like this sooo I'm tempted to call it good enough and go on with my life :) (also it was like this initially, I did not try to be creative)
All I missing a clear issue that flexbox addresses here?

margin-right: 6px;
max-width: 48px;
max-height: 32px;
}

#chat .toggle-content .head,
#chat .toggle-content .body {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

#chat .toggle-content .head {
Expand All @@ -1129,9 +1139,6 @@ kbd {

#chat .toggle-content .body {
color: #999;
max-width: 460px;
word-break: normal;
word-wrap: break-word;
}

#chat .toggle-content.show {
Expand Down
2 changes: 1 addition & 1 deletion client/views/toggle.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#toggle}}
<div class="toggle-content">
<div class="toggle-content toggle-type-{{type}}">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary anymore @maxpoulin64, what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be useful for themes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

{{#equal type "image"}}
<a href="{{link}}" target="_blank">
<img src="{{link}}">
Expand Down