mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix #1786 don't add width/height styles if they are zero
This commit is contained in:
parent
22781e2117
commit
5311b73d68
1 changed files with 4 additions and 4 deletions
|
|
@ -86,8 +86,8 @@
|
|||
else if($form.find('#align_middle').attr('checked') == 'checked') align = 'middle';
|
||||
else if($form.find('#align_right').attr('checked') == 'checked') align = 'right';
|
||||
|
||||
var width = $form.find('#width').val();
|
||||
var height = $form.find('#height').val();
|
||||
var width = parseInt($form.find('#width').val(), 10);
|
||||
var height = parseInt($form.find('#height').val(), 10);
|
||||
|
||||
if(!url) {
|
||||
window.close();
|
||||
|
|
@ -101,11 +101,11 @@
|
|||
|
||||
img_attrs.src = url;
|
||||
if(alt) img_attrs.alt = alt;
|
||||
if(width) {
|
||||
if(width > 0) {
|
||||
img_attrs.width = width;
|
||||
img_style.width = width;
|
||||
}
|
||||
if(height) {
|
||||
if(height > 0) {
|
||||
img_attrs.height = height;
|
||||
img_style.height = height;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue