From 68a0e505bfa700f42308e1df964752479f5c4867 Mon Sep 17 00:00:00 2001 From: Dean Attali Date: Mon, 13 Jul 2020 01:09:27 -0400 Subject: [PATCH] Fix staticman UI to work with bootstrap 4; fixes #679 (#681) --- _includes/staticman-comments.html | 12 ++++++------ assets/js/staticman.js | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/_includes/staticman-comments.html b/_includes/staticman-comments.html index bb14e66..dc918b1 100644 --- a/_includes/staticman-comments.html +++ b/_includes/staticman-comments.html @@ -39,7 +39,7 @@ - {% endif %}
- - + +
diff --git a/assets/js/staticman.js b/assets/js/staticman.js index 7472722..09422a6 100644 --- a/assets/js/staticman.js +++ b/assets/js/staticman.js @@ -21,18 +21,18 @@ layout: null data: $(this).serialize(), contentType: 'application/x-www-form-urlencoded', success: function (data) { - $('#comment-form-submit').addClass('hidden'); - $('#comment-form-submitted').removeClass('hidden'); - $('.page__comments-form .js-notice').removeClass('notice--danger'); - $('.page__comments-form .js-notice').addClass('notice--success'); + $('#comment-form-submit').addClass('d-none'); + $('#comment-form-submitted').removeClass('d-none'); + $('.page__comments-form .js-notice').removeClass('alert-danger'); + $('.page__comments-form .js-notice').addClass('alert-success'); showAlert('success'); }, error: function (err) { console.log(err); - $('#comment-form-submitted').addClass('hidden'); - $('#comment-form-submit').removeClass('hidden'); - $('.page__comments-form .js-notice').removeClass('notice--success'); - $('.page__comments-form .js-notice').addClass('notice--danger'); + $('#comment-form-submitted').addClass('d-none'); + $('#comment-form-submit').removeClass('d-none'); + $('.page__comments-form .js-notice').removeClass('alert-success'); + $('.page__comments-form .js-notice').addClass('alert-danger'); showAlert('failure'); $(form).removeClass('disabled'); } @@ -42,13 +42,13 @@ layout: null }); function showAlert(message) { - $('.page__comments-form .js-notice').removeClass('hidden'); + $('.page__comments-form .js-notice').removeClass('d-none'); if (message == 'success') { - $('.page__comments-form .js-notice-text-success').removeClass('hidden'); - $('.page__comments-form .js-notice-text-failure').addClass('hidden'); + $('.page__comments-form .js-notice-text-success').removeClass('d-none'); + $('.page__comments-form .js-notice-text-failure').addClass('d-none'); } else { - $('.page__comments-form .js-notice-text-success').addClass('hidden'); - $('.page__comments-form .js-notice-text-failure').removeClass('hidden'); + $('.page__comments-form .js-notice-text-success').addClass('d-none'); + $('.page__comments-form .js-notice-text-failure').removeClass('d-none'); } } })(jQuery);