Commit 8bb160d5 by Скуратович Александр

Фильтр ввода и удаление картинки

1 parent 0537ecd5
......@@ -204,6 +204,8 @@ $(document).ready(
rows.push('<tr>'+cols.join('')+'</tr>');
}
el_table.html('<tbody>'+rows.join('')+'</tbody>');
$(el_wrap).find('.img-calc').remove();
}
}
......@@ -215,6 +217,22 @@ $(document).ready(
{
fenix_calc($(this).closest('.fenix_calc'));
}
).on(
'change.fenix',
'.fenix_calc input[type="number"][min][max]',
function ()
{
var inp_val = $(this).val();
var inp_val_int = inp_val|0;
var inp_min = $(this).attr('min')|0;
var inp_max = $(this).attr('max')|0;
if (inp_val_int<inp_min)
inp_val_int=inp_min;
if (inp_val_int>inp_max)
inp_val_int=inp_max;
if ((inp_val).toString() != (inp_val_int).toString())
$(this).val(inp_val_int);
}
);
}
);
\ No newline at end of file
......@@ -42,7 +42,7 @@ function fenix_calc ($atts, $content)
'<table class="table table-striped table-hover table-bordered table_result"></table>'.
(
has_post_thumbnail($post->ID)?
'<img src="'.get_the_post_thumbnail_url($post->ID, 'full').'" class="img-fluid mb-4 mb-md-0"/>':
'<img src="'.get_the_post_thumbnail_url($post->ID, 'full').'" class="img-fluid mb-4 mb-md-0 img-calc"/>':
''
).
'</div>'.
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!