Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
395aa8cb
Commit
395aa8cb
authored
Oct 13, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use JS to dynamically set height of img modal
parent
e73d1430
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
sass/_modal.scss
sass/_modal.scss
+0
-1
src/modals/image.js
src/modals/image.js
+4
-1
src/templates/image_modal.js
src/templates/image_modal.js
+14
-13
No files found.
sass/_modal.scss
View file @
395aa8cb
...
...
@@ -29,7 +29,6 @@
}
}
.modal-body--image
{
height
:
72vh
;
.chat-image
{
max-height
:
99%
;
max-width
:
100%
;
...
...
src/modals/image.js
View file @
395aa8cb
...
...
@@ -4,6 +4,9 @@ import tpl_image_modal from "../templates/image_modal.js";
export
default
BootstrapModal
.
extend
({
toHTML
()
{
return
tpl_image_modal
({
'
src
'
:
this
.
src
});
return
tpl_image_modal
({
'
src
'
:
this
.
src
,
'
onload
'
:
ev
=>
(
ev
.
target
.
parentElement
.
style
.
height
=
`
${
ev
.
target
.
height
}
px`
)
});
}
});
src/templates/image_modal.js
View file @
395aa8cb
...
...
@@ -3,7 +3,8 @@ import { __ } from '../i18n';
import
{
modal_close_button
,
modal_header_close_button
}
from
"
./buttons
"
export
default
(
o
)
=>
html
`
export
default
(
o
)
=>
{
return
html
`
<div class="modal-dialog fit-content" role="document">
<div class="modal-content fit-content">
<div class="modal-header">
...
...
@@ -11,9 +12,9 @@ export default (o) => html`
${
modal_header_close_button
}
</div>
<div class="modal-body modal-body--image fit-content">
<img class="chat-image" src="
${
o
.
src
}
"/
>
<img class="chat-image" src="
${
o
.
src
}
" @load=
${
o
.
onload
}
>
</div>
<div class="modal-footer">
${
modal_close_button
}
</div>
</div>
</div>
`
;
</div>`
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment