Fix step comments bugs (#1751)

This commit is contained in:
aignatov-bio 2019-05-13 09:49:53 +02:00 committed by GitHub
parent 0b194eb3b1
commit 2010b3ad8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 8 deletions

View file

@ -206,6 +206,24 @@ var Comments = (function() {
$form.submit(); $form.submit();
}); });
$form.find('textarea').on('focus', function(){
$(this).addClass('border');
if (this.value.length > 0) {
$submitBtn.addClass('show');
}
}).on('blur',function(){
if (this.value.length == 0) {
$(this).removeClass('border');
$submitBtn.removeClass('show');
}
}).on('keyup',function(){
if (this.value.length > 0) {
$submitBtn.addClass('show');
} else {
$submitBtn.removeClass('show');
}
})
$('.help-block', $form).addClass('hide'); $('.help-block', $form).addClass('hide');
$form.off().on('ajax:send', function () { $form.off().on('ajax:send', function () {

View file

@ -297,7 +297,6 @@
line-height: 16px; line-height: 16px;
overflow: hidden; overflow: hidden;
padding: 2px 5px; padding: 2px 5px;
pointer-events: none;
width: 100%; width: 100%;
&:focus { &:focus {
@ -307,6 +306,7 @@
&:disabled { &:disabled {
background: transparent; background: transparent;
border: 1px solid transparent; border: 1px solid transparent;
pointer-events: none;
user-select: none; user-select: none;
} }
} }
@ -448,7 +448,7 @@
outline: none; outline: none;
} }
&:hover { &.border {
border: 1px solid $color-silver; border: 1px solid $color-silver;
} }
} }
@ -462,8 +462,8 @@
right: -36px; right: -36px;
transition: $md-transaction; transition: $md-transaction;
&.has-error { &.show {
top: -64px; right: 0;
} }
} }
@ -472,9 +472,5 @@
textarea { textarea {
border: 1px solid $color-silver; border: 1px solid $color-silver;
} }
.new-comment-button {
right: 0;
}
} }
} }