Skip to content

Commit

Permalink
Merge d86cee4 into cf34260
Browse files Browse the repository at this point in the history
  • Loading branch information
vaninanton committed Feb 20, 2018
2 parents cf34260 + d86cee4 commit e0dc472
Showing 1 changed file with 17 additions and 27 deletions.
44 changes: 17 additions & 27 deletions resources/views/reklama/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,26 @@

@push('scripts')
<script>
var opt = <?= setting('rekuseroptprice'); ?>;
var price = $('.js-price');
var bold = $('.js-bold');
var color = $('.js-color');
$(document).ready(function() {
if (bold.is(':checked')) {
price.html(parseInt(price.text()) + opt);
}
bold.change(function() {
if (this.checked) {
price.html(parseInt(price.text()) + opt);
} else {
price.html(parseInt(price.text()) - opt);
var rekuserprice = <?= setting('rekuserprice'); ?>;
var rekuseroptprice = <?= setting('rekuseroptprice'); ?>;
var price = $('.js-price');
var bold = $('.js-bold');
var color = $('.js-color');
var recount = function() {
var newprice = parseInt(rekuserprice);
if (bold.is(':checked')) {
newprice += parseInt(rekuseroptprice);
}
});
if (color.val().length) {
price.html(parseInt(price.text()) + opt);
}
color.change(function() {
if ($('.js-color').val().length) {
price.html(parseInt(price.text()) + opt);
} else {
price.html(parseInt(price.text()) - opt);
if (color.val().length) {
newprice += parseInt(rekuseroptprice);
}
});
price.html(newprice);
};
recount();
bold.on('change', recount);
color.on('input change', recount);
});
</script>
@endpush
Expand Down

0 comments on commit e0dc472

Please sign in to comment.