Merge pull request #451 from openclassify/vedat

#1169
This commit is contained in:
Fatih Alp 2020-03-25 17:29:08 +03:00 committed by GitHub
commit 53131b9fb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 4 deletions

View File

@ -184,4 +184,24 @@ $(document).ready(function () {
.attr('contenteditable', false);
}
});
});
});
$(document).ready(function () {
$(".priceField").inputmask('currency', {
rightAlign: true,
prefix: "",
'groupSeparator': '.',
'autoGroup': true,
'digits': 2,
'radixPoint': ",",
'digitsOptional': false,
'allowMinus': false,
'placeholder': '0,00'
});
$(".priceField").on('change',function () {
var price = parseFloat($(".priceField").val().replace('.','').replace(',','.'));
$('.priceHidden').find('input').val(price);
})
});

View File

@ -59,11 +59,14 @@
{{ form.fields.price.label|raw }}
<span class="required">*</span>
</label>
<div class="col-sm-4 col-xs-6">
<div class="col-sm-4 col-xs-6 priceHidden d-none">
{{ form.fields.price.setAttributes({
'required' :true,
'required' :true
}).input|raw }}
</div>
<div class="col-sm-4 col-xs-6">
<input class="form-control priceField" value="{{ form.fields.price.value }}">
</div>
<div class="col-sm-3 col-xs-6">
{{ form.fields.currency.setAttributes({
'required' :true,

View File

@ -19,7 +19,9 @@ class AdvFormBuilder extends FormBuilder
'unique' => true,
'required' => true,
],
'price',
'price' => [
'type' => 'anomaly.field_type.text'
],
'advs_desc',
'cat1',
'cat2',

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,8 @@
{{ asset_add("theme.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/utils.js") }}
{{ asset_add("theme.js", "theme::js/phoneField.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/jquery.inputmask.bundle.min.js") }}
{# Theme Scripts #}
@ -39,3 +41,4 @@
{{ style|raw }}
{% endfor %}
</style>