diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-01-21 14:57:51 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-01-21 14:57:51 +0100 |
| commit | 3ce1a44ab308f4c483541944aa777ec8aa91af2b (patch) | |
| tree | f0e7d20561909ae8d4d12768c0b0aa248b446a78 | |
| parent | 53de20f4997fdcbd7f50cb29dd7783ea497a631a (diff) | |
code maxwidth
| -rw-r--r-- | public/assets/css/bucky.css | 9 | ||||
| -rw-r--r-- | public/assets/js/lib/views/details/commentform.js | 4 | ||||
| -rw-r--r-- | views/partials/comments.ejs | 2 |
3 files changed, 10 insertions, 5 deletions
diff --git a/public/assets/css/bucky.css b/public/assets/css/bucky.css index 46903fc..9096367 100644 --- a/public/assets/css/bucky.css +++ b/public/assets/css/bucky.css @@ -466,6 +466,7 @@ pre { margin: 2px; padding: 5px; border: 1px solid #ddd; + max-width: 580px; } code br, pre br { @@ -545,7 +546,7 @@ pre br { border-color: #ddd; height: 240px; } -#comment_form textarea:invalid { +#comment_form textarea.empty { background: transparent; border-color: transparent; border-bottom: 1px solid #333; @@ -553,13 +554,13 @@ pre br { opacity: 0.5; padding: 5px 5px 0 0px; } -#comment_form textarea:invalid::placeholder { +#comment_form textarea.empty::placeholder { color: black; } -#comment_form.focused textarea:invalid::placeholder { +#comment_form.focused textarea.empty::placeholder { color: #888; } -.black #comment_form textarea:invalid::placeholder { +.black #comment_form textarea.empty::placeholder { color: #fff; padding-bottom: 4px; border-bottom: 1px solid #fff; diff --git a/public/assets/js/lib/views/details/commentform.js b/public/assets/js/lib/views/details/commentform.js index 9a748f9..7f04ec3 100644 --- a/public/assets/js/lib/views/details/commentform.js +++ b/public/assets/js/lib/views/details/commentform.js @@ -18,6 +18,7 @@ var CommentForm = FormView.extend({ load: function(thread){ this.action = "/api/thread/" + thread.id + "/comment" + this.$comment.addClass('empty') if (thread.settings.noupload) { this.$("[type=file]").hide() } @@ -33,6 +34,7 @@ var CommentForm = FormView.extend({ focus: function(){ this.$el.addClass('focused') + this.$comment.removeClass('empty') $("[name=comment]").prop("required", false) }, @@ -47,6 +49,8 @@ var CommentForm = FormView.extend({ }, success: function(){ + $("[name=comment").val('') + $("[name=files").val('') window.location.reload() } }) diff --git a/views/partials/comments.ejs b/views/partials/comments.ejs index 87c9dec..82fdd27 100644 --- a/views/partials/comments.ejs +++ b/views/partials/comments.ejs @@ -28,7 +28,7 @@ <td></td> <td colspan="2"> <form> - <textarea required name="comment" placeholder="Add a comment"></textarea> + <textarea name="comment" placeholder="Add a comment"></textarea> <div class="inputs"> <input name="files" type="file" multiple> <input type="submit" value="POST" /> |
