Skip to content

Commit ed0c3ad

Browse files
committed
created config param for "cite as" feature
1 parent 67b8bc1 commit ed0c3ad

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

vis/js/default-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,10 @@ var config = {
177177
faqs_button: false,
178178
//url for link to faqs
179179
faqs_url: "",
180-
// show citation button
180+
// show citation button for the whole map
181181
show_cite_button: false,
182+
// show citation button for each paper
183+
cite_papers: false,
182184

183185
/*** streamgraph settings ***/
184186
//streamgraph color definition

vis/js/reducers/list.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const list = (
1717
showKeywords: false,
1818
hideUnselectedKeywords: true,
1919
height: null,
20+
citePapers: false,
2021
},
2122
action
2223
) => {
@@ -47,6 +48,7 @@ const list = (
4748
hideUnselectedKeywords: config.hide_keywords_overview,
4849
disableClicks: !config.render_map,
4950
height: action.listHeight,
51+
citePapers: config.cite_papers,
5052
};
5153
case "TOGGLE_LIST":
5254
return {

vis/js/templates/listentry/PaperButtons.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const PaperButtons = ({
3131
<div className="paper_buttons_row">
3232
{!!onPDFClick && (
3333
<button className="paper_button main" onClick={handlePDFButtonClick}>
34-
<i className="far fa-file-pdf"></i>&nbsp;&nbsp;<Highlight>PDF</Highlight>
34+
<i className="far fa-file-pdf"></i>&nbsp;&nbsp;
35+
<Highlight>PDF</Highlight>
3536
</button>
3637
)}
3738
{showCiteButton && (
@@ -45,7 +46,8 @@ const PaperButtons = ({
4546
};
4647

4748
const mapStateToProps = (state) => ({
48-
showCiteButton: ["base", "pubmed"].includes(state.service),
49+
//showCiteButton: ["base", "pubmed"].includes(state.service),
50+
showCiteButton: state.list.citePapers,
4951
});
5052

5153
export default connect(

0 commit comments

Comments
 (0)