Skip to content

Commit

Permalink
Merge pull request #1638 from frknbasaran/feedback-ui-fixes
Browse files Browse the repository at this point in the history
[feedback-ui-fixes] ui fixes.
  • Loading branch information
ar2rsawseen authored Nov 5, 2020
2 parents 3ff07ab + f12e689 commit 7c86fb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 12 additions & 7 deletions plugins/star-rating/frontend/public/javascripts/countly.views.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ window.starView = countlyView.extend({
}
row.target_pages.forEach(function(page) {
if (row.target_pages.indexOf(page) < 5) {
target_pages += "<div class='feedback-widget-target-page-item'>" + page + "</div>";
target_pages += "<a class='feedback-widget-target-page-item' title='" + page + "'>" + (page.length < 20 ? page : (page.substr(0, 20) + "...")) + "</a>";
}
else if (row.target_pages.indexOf(page) === 5) {
target_pages += "<div class='feedback-widget-target-page-item'>And " + (row.target_pages.length - 5) + " more...</div>";
Expand Down Expand Up @@ -1160,6 +1160,11 @@ window.starView = countlyView.extend({
"display": "block"
});
},
decode: function(string) {
var div = document.createElement("div");
div.innerHTML = string;
return typeof div.textContent !== 'undefined' ? div.textContent : div.innerText;
},
renderCommon: function(isRefresh) {
var self = this;
new ClipboardJS('.copy-widget-id');
Expand Down Expand Up @@ -1746,12 +1751,12 @@ window.starView = countlyView.extend({
}
});
var renderFeedbackWidgetModal = function(isCreate) {
$("#feedback-popup-header-text").val(isCreate ? "" : self.feedbackWidget.popup_header_text);
$("#feedback-popup-comment-text").val(isCreate ? "" : self.feedbackWidget.popup_comment_callout);
$("#feedback-popup-email-text").val(isCreate ? "" : self.feedbackWidget.popup_email_callout);
$("#feedback-popup-button-text").val(isCreate ? "" : self.feedbackWidget.popup_button_callout);
$("#feedback-popup-thanks-text").val(isCreate ? "" : self.feedbackWidget.popup_thanks_message);
$("#feedback-trigger-text").val(isCreate ? "" : self.feedbackWidget.trigger_button_text);
$("#feedback-popup-header-text").val(isCreate ? "" : self.decode(self.feedbackWidget.popup_header_text));
$("#feedback-popup-comment-text").val(isCreate ? "" : self.decode(self.feedbackWidget.popup_comment_callout));
$("#feedback-popup-email-text").val(isCreate ? "" : self.decode(self.feedbackWidget.popup_email_callout));
$("#feedback-popup-button-text").val(isCreate ? "" : self.decode(self.feedbackWidget.popup_button_callout));
$("#feedback-popup-thanks-text").val(isCreate ? "" : self.decode(self.feedbackWidget.popup_thanks_message));
$("#feedback-trigger-text").val(isCreate ? "" : self.decode(self.feedbackWidget.trigger_button_text));

$("#counter-for-feedback-popup-header-text").html($("#feedback-popup-header-text").val().length + "/45");
$("#counter-for-feedback-popup-comment-text").html($("#feedback-popup-comment-text").val().length + "/25");
Expand Down
2 changes: 2 additions & 0 deletions plugins/star-rating/frontend/public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
.routename-star .feedback-widget-target-page-item {
margin-bottom: 3px;
font-size: 11px;
cursor: pointer;
display: block;
}

.routename-star .pickpanel {
Expand Down

0 comments on commit 7c86fb1

Please sign in to comment.