From 0aaf1ec507c1dbf87a08be1f029f030c7c4284c8 Mon Sep 17 00:00:00 2001 From: Vincent Tam Date: Tue, 21 May 2019 14:56:40 +0200 Subject: =?UTF-8?q?Fix=C3=A9=20le=20bouton=20"Reset"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Grâce à https://stackoverflow.com/a/193787/3184351 --- assets/css/staticman.css | 11 ++++++----- assets/js/staticman.js | 6 +++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/assets/css/staticman.css b/assets/css/staticman.css index 9581eb8..5c41c99 100644 --- a/assets/css/staticman.css +++ b/assets/css/staticman.css @@ -9,16 +9,17 @@ .staticman-comments input { margin: .3rem 0; - padding:.4rem .8rem; + padding: .4rem .8rem; border: .1rem solid #768294; - border-radius:3px; - background-color:#fff; + border-radius: 3px; + background-color: #fff; width: 60%; max-width: 95%; display: block; } .staticman-comments input[type="submit"], .staticman-comments input[type="reset"] { + background-color: #ebeffa; width: auto; display: inline; } @@ -29,9 +30,9 @@ .staticman-comments textarea { margin: .3rem 0; - padding:.2rem .4rem; + padding: .2rem .4rem; border: .1rem solid #768294; - border-radius:2px; + border-radius: 2px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; diff --git a/assets/js/staticman.js b/assets/js/staticman.js index efc5aad..3ea1e98 100644 --- a/assets/js/staticman.js +++ b/assets/js/staticman.js @@ -43,7 +43,11 @@ $(document).ready(function() { } function clearForm() { - $('.js-form input:not(.button)').val(''); // empty all text & hidden fields + $('.js-form input') + .filter(function() { + return this.name.match(/^fields\[.*\]$/); + }) + .val(''); // empty all text & hidden fields $('.js-form textarea').val(''); // empty text area $('.js-form .reply-notice-text').text(''); // reset reply target $('.js-form .reply-notice').addClass('hidden'); // hide reply target display -- cgit v1.2.3