Remove unnecessary reaction call (#5122) [deploy]

Clicking the button to follow people on search page was erroneously
triggering a reaction request, thus not having the reactable_id.

We've updated the handlers not to trigger it.
This commit is contained in:
Matheus Azzi 2019-12-19 13:03:34 -03:00 committed by Ben Halpern
parent 4a2e55ff06
commit 662a99ade3
7 changed files with 9 additions and 10 deletions

View file

@ -9,7 +9,6 @@ function initializeAllFollowButts() {
function initializeFollowButt(butt) {
var user = userData();
var deviceWidth = window.innerWidth > 0 ? window.innerWidth : screen.width;
var buttInfo = JSON.parse(butt.dataset.info);
var userStatus = document
.getElementsByTagName('body')[0]

View file

@ -14,7 +14,7 @@ function initializeReadingListIcons() {
// set SAVE or SAVED articles buttons
function setReadingListButtonsState() {
var readingListButtons = document.getElementsByClassName('bookmark-engage');
var readingListButtons = document.getElementsByClassName('bookmark-button');
Array.from(readingListButtons).forEach(highlightButton);
}
@ -150,7 +150,7 @@ function isReadingListButtonHoverTarget(element) {
return (
(element.tagName === 'BUTTON' &&
classList.contains('bookmark-engage') &&
classList.contains('bookmark-button') &&
classList.contains('selected')) ||
(element.tagName === 'SPAN' && classList.contains('bm-success'))
);

View file

@ -77,12 +77,12 @@ function buildArticleHTML(article) {
}
var saveButton = '';
if (article.class_name === "Article") {
saveButton = '<button type="button" class="article-engagement-count bookmark-engage" data-reactable-id="'+article.id+'">\
saveButton = '<button type="button" class="article-engagement-count engage-button bookmark-button" data-reactable-id="'+article.id+'">\
<span class="bm-initial">SAVE</span>\
<span class="bm-success">SAVED</span>\
</button>'
} else if (article.class_name === "User") {
saveButton = '<button type="button" style="width: 122px" class="article-engagement-count bookmark-engage follow-action-button"\
saveButton = '<button type="button" style="width: 122px" class="article-engagement-count engage-button follow-action-button"\
data-info=\'{"id":'+article.id+',"className":"User"}\' data-follow-action-button>\
&nbsp;\
</button>'

View file

@ -772,7 +772,7 @@
&.reactions-count {
left: 20px;
}
&.bookmark-engage {
&.engage-button {
right: 12px;
border: 2px solid transparent;
border-radius: 3px;
@ -809,7 +809,7 @@
margin-top: -38px;
bottom: auto;
z-index: 10;
&.bookmark-engage {
&.engage-button {
margin-top: -39px;
}
}

View file

@ -184,7 +184,7 @@
}
}
}
.bookmark-engage {
.engage-button {
font-family: $helvetica-condensed;
background: darken($purple, 26%);
color: white;

View file

@ -57,7 +57,7 @@
</a>
<button
type="button"
class="article-engagement-count bookmark-engage"
class="article-engagement-count engage-button bookmark-button"
data-reactable-id="<%= story.id %>"
aria-label="Save to reading list"
title="Save to reading list">

View file

@ -135,7 +135,7 @@
</a>
<button
type="button"
class="article-engagement-count bookmark-engage featured-engagement-count"
class="article-engagement-count engage-button bookmark-button featured-engagement-count"
data-reactable-id="<%= @featured_story.id %>"
aria-label="Save to reading list"
title="Save to reading list">