Center and scale images in attachment preview frame (#5421)

pull/5432/head
Aleksander Machniak 8 years ago
parent 4bf4afec68
commit 2e1675bc4a

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Center and scale images in attachment preview frame (#5421)
- Added max_message_size option enforced when attaching files to a composed message (#4993)
- Added Search button in quick search menus (#5312)
- Implement "one click" attachment/messages/photo upload (#5024)

@ -348,6 +348,15 @@ function rcube_webmail()
if (this.env.list_post)
this.enable_command('reply-list', true);
}
// center and scale the image in preview frame
if (this.env.mimetype.startsWith('image/'))
$(this.gui_objects.messagepartframe).on('load', function() {
var css = 'img { max-width:100%; max-height:100%; } ' // scale
+ 'body { display:flex; align-items:center; justify-content:center; height:100%; margin:0; }'; // align
$(this).contents().find('head').append('<style type="text/css">'+ css + '</style>');
});
}
// show printing dialog
else if (this.env.action == 'print' && this.env.uid

Loading…
Cancel
Save