From 2867dfd388d23b0e11f53250483396f6a3680930 Mon Sep 17 00:00:00 2001 From: chench53 Date: Fri, 20 Sep 2019 18:18:06 +0800 Subject: [PATCH] Use Font Awesome for close icon, make it optional --- README.md | 1 + js/jquery-comments.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f7e0ba3..cee9cc8 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ If you are not using Font Awesome for icons, you should replace the icons with c ```javascript spinnerIconURL: '', noCommentsIconURL: '', +closeIconURL: '', upvoteIconURL: '', // Only if upvoting is enabled replyIconURL: '', // Only if replying is enabled uploadIconURL: '', // Only if attachments are enabled diff --git a/js/jquery-comments.js b/js/jquery-comments.js index 604b306..cd6e949 100644 --- a/js/jquery-comments.js +++ b/js/jquery-comments.js @@ -125,6 +125,7 @@ attachmentIconURL: '', fileIconURL: '', noCommentsIconURL: '', + closeIconURL: '', // Strings to be formatted (for example localization) textareaPlaceholderText: 'Add a comment', @@ -1330,7 +1331,14 @@ // Close button var closeButton = $('', { 'class': 'close inline-button' - }).append($('')).append($('')); + }) + + var closeIcon = $(''); + if (this.options.closeIconURL.length) { + closeIcon.css('background-image', 'url("'+this.options.closeIconURL+'")'); + closeIcon.addClass('image'); + } + closeButton.append(closeIcon); // Save button text if(existingCommentId) {