Здравствуйте!
Проблема со скриптом:
<script type="text/javascript">
tbApp.onScriptLoaded(function() {
$('#review').delegate('.pagination a', 'click', function(e) {
e.preventDefault();
$('#review').fadeOut('slow');
$('#review').load(this.href);
$('#review').fadeIn('slow');
});
$('#review').load('index.php?route=product/product/review&product_id=332');
$('#tbReviewFormWrap').detach().appendTo('body');
$('.tbReviewForm .buttons .btn').bind('click', function() {
$.ajax({
url: 'index.php?route=product/product/write&product_id=332',
type: 'post',
dataType: 'json',
data: $(".tbReviewForm").serialize(),
beforeSend: function() {
$('.tbReviewForm').addClass('tb_blocked tb_loading');
$('.tbReviewForm').prepend('<i class="fa fa-circle-o-notch fa-spin"></i>');
$('.tbReviewForm .buttons .tb_button').attr('disabled', true);
},
complete: function() {
$('#captcha').attr('src', 'index.php?route=tool/captcha#'+new Date().getTime());
$('input[name=\'captcha\']').val('');
},
success: function(json) {
$('.tbReviewForm .alert').remove();
$('.tbReviewForm').find('> .fa-spin').remove();
$('.tbReviewForm').removeClass('tb_blocked tb_loading');
$('.tbReviewForm .tb_submit .tb_button').attr('disabled', false);
if (json['error']) {
$('.tbReviewForm').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
}
if (json['success']) {
$('.tbReviewForm').before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
$('.tbReviewForm').hide();
$('input[name=\'name\']').val('');
$('textarea[name=\'text\']').val('');
$('input[name=\'rating\']:checked').prop('checked', false);
$('#captcha').attr('src', 'index.php?route=tool/captcha#'+new Date().getTime());
$('input[name=\'captcha\']').val('');
if (typeof grecaptcha != 'undefined' && grecaptcha.reset !== undefined) {
grecaptcha.reset();
}
var closeDialogTimeout = setTimeout(function(){
$("#tbReviewFormWrap").modal('hide');
}, 4000);
$("#tbReviewFormWrap").on('hidden.bs.modal', function() {
$('#tbReviewFormWrap .alert').remove();
$('.tbReviewForm').show();
clearTimeout(closeDialogTimeout);
});
}
}
});
});
});
</script>
Модальное окно с отзывом открыл кое-как, но вот закрыть его - не получается.
На закрытие вижу такой код:
<a class="close" href="javascript:;" data-dismiss="modal">
<svg><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://babysib-nsk.ru/kombinezon-transformer-zima-goroshek-arsi-kapuchino-r68-74.html#close"></use></svg>
</a>
т.е. и здесь ошибка
Как решить? А фгзнт, разбираться надо