Skip to content

Commit 4a7fe64

Browse files
committed
hiding new share buttons in embed mode
1 parent 3319676 commit 4a7fe64

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

vis/js/reducers/modals.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const modals = (
4444
openCitationModal: false,
4545
citedPaper: null,
4646
exportedPaper: null,
47-
showTwitterButton: !!action.configObject.show_twitter_button,
48-
showEmailButton: !!action.configObject.show_email_button,
47+
showTwitterButton: showTwitterShare(action.configObject, action.contextObject),
48+
showEmailButton: showEmailShare(action.configObject, action.contextObject),
4949
};
5050
case "OPEN_EMBED_MODAL":
5151
return {
@@ -148,3 +148,17 @@ const getSheetID = (config, context) => {
148148

149149
return config.files[0].file;
150150
};
151+
152+
const showTwitterShare = (config, context) => {
153+
if (config.credit_embed) {
154+
return false;
155+
}
156+
return !!config.show_twitter_button;
157+
};
158+
159+
const showEmailShare = (config, context) => {
160+
if (config.credit_embed) {
161+
return false;
162+
}
163+
return !!config.show_email_button;
164+
};

0 commit comments

Comments
 (0)