diff --git a/common/modules/comment/resources/comment.js b/common/modules/comment/resources/comment.js index 3165bc3..65af2b1 100644 --- a/common/modules/comment/resources/comment.js +++ b/common/modules/comment/resources/comment.js @@ -1,5 +1,38 @@ $(function() { + function addRemoveBlocks(data) + { + $('#overlay, .succses_comm').remove(); + $('body').append('
').append('
'+data.text+'
'); + $('#overlay').fadeIn( + 400, function() + { + $('.succses_comm').css({display : 'block'}).animate({opacity : 1, top : '50%'}, 200); + } + ); + function closeSuccsescomm() { + $('.succses_comm') + .animate( + {opacity : 0, top : '30%'}, 200, function() + { + $(this).css('display', 'none') + $('#overlay').fadeOut( + 400, function() + { + $('#overlay, .succses_comm').remove() + } + ) + } + ) + } + $('body').on('click', '.closed-form, #overlay', function() { + closeSuccsescomm() + } + ); + + setTimeout(closeSuccsescomm, 4000) + } + $(document).on('click', '.artbox_comment_container .removeable', function(e) { e.preventDefault(); $(this).parent().remove(); @@ -25,8 +58,11 @@ $(function() { { if(!data.error) { - $(container).empty(); - $(container).append('

' + data.text + '

'); + { + $(container).remove(); + addRemoveBlocks(data) + // $(container).append('

' + data.text + '

'); + } } else { $(container).prepend('

' + data.error + '

') @@ -173,40 +209,7 @@ $(function() { if(!data.error) { $(container).remove(); - addRemoveBlocks() - function addRemoveBlocks() - { - $('#overlay, .succses_comm').remove(); - $('body').append('
').append('
'+data.text+'
'); - $('#overlay').fadeIn( - 400, function() - { - $('.succses_comm').css({display : 'block'}).animate({opacity : 1, top : '50%'}, 200); - } - ); - function closeSuccsescomm() { - $('.succses_comm') - .animate( - {opacity : 0, top : '30%'}, 200, function() - { - $(this).css('display', 'none') - $('#overlay').fadeOut( - 400, function() - { - $('#overlay, .succses_comm').remove() - } - ) - } - ) - } - $('body').on('click', '.closed-form, #overlay', function() { - closeSuccsescomm() - } - ); - - setTimeout(closeSuccsescomm, 4000) - } - // $(container).append('

' + data.text + '

'); + addRemoveBlocks(data) } else { $(container).prepend('

' + data.error + '

') diff --git a/common/modules/comment/widgets/views/form-comment.php b/common/modules/comment/widgets/views/form-comment.php index c14055e..816f803 100644 --- a/common/modules/comment/widgets/views/form-comment.php +++ b/common/modules/comment/widgets/views/form-comment.php @@ -30,7 +30,7 @@ if($model->scenario == $model::SCENARIO_GUEST) { echo $form->field($model, 'user_name', [ 'options' => [ - 'class' => 'input-blocks-comm', + 'class' => 'input-blocks-comm fix_marg_', ], 'inputOptions' => [ 'class' => 'custom-input-4', diff --git a/common/modules/comment/widgets/views/project_comment_view.php b/common/modules/comment/widgets/views/project_comment_view.php index 266d76c..4c930d8 100644 --- a/common/modules/comment/widgets/views/project_comment_view.php +++ b/common/modules/comment/widgets/views/project_comment_view.php @@ -28,12 +28,12 @@ if(!empty( $user ) && !empty( $user->userInfo->image )) { echo ""; } else { - echo ""; + echo ""; } ?> -
-
+
+
' . $user->firstname . ' ' . $user->lastname . '', [ @@ -56,7 +56,7 @@ } ?>
-