diff --git a/src/js/widgets/abstract/templates/abstract_template.html b/src/js/widgets/abstract/templates/abstract_template.html index 587b8c812..c39d42425 100644 --- a/src/js/widgets/abstract/templates/abstract_template.html +++ b/src/js/widgets/abstract/templates/abstract_template.html @@ -152,17 +152,22 @@

Abstract

Bibcode:
- + +
{{#if keyword}} diff --git a/src/js/widgets/abstract/widget.js b/src/js/widgets/abstract/widget.js index b4ff4dfc4..70b0564f4 100644 --- a/src/js/widgets/abstract/widget.js +++ b/src/js/widgets/abstract/widget.js @@ -5,6 +5,7 @@ define([ 'marionette', 'js/components/api_request', 'js/components/api_targets', + 'clipboard', 'backbone', 'jquery', 'underscore', @@ -22,6 +23,7 @@ define([ Marionette, ApiRequest, ApiTargets, + Clipboard, Backbone, $, _, @@ -264,6 +266,17 @@ define([ ); }, + copyBibcode() { + if (!this.bibcodeClipboard) { + this.bibcodeClipboard = new Clipboard('#abs-bibcode-copy'); + this.bibcodeClipboard.on('success', () => { + $('#abs-bibcode-copy-msg') + .show() + .fadeOut(1000); + }); + } + }, + onRender: function() { this.$('.icon-help').popover({ trigger: 'hover', @@ -284,6 +297,7 @@ define([ this.$('.s-abstract-text', this.el).get(0), ]); } + this.copyBibcode(); }, }); diff --git a/src/js/wraps/abstract_page_manager/abstract-page-layout.html b/src/js/wraps/abstract_page_manager/abstract-page-layout.html index d6e3e00a3..2247fee74 100644 --- a/src/js/wraps/abstract_page_manager/abstract-page-layout.html +++ b/src/js/wraps/abstract_page_manager/abstract-page-layout.html @@ -20,7 +20,6 @@
-
diff --git a/src/styles/sass/ads-sass/abstract-page-widgets.scss b/src/styles/sass/ads-sass/abstract-page-widgets.scss index 2b7a14ec1..2719f16eb 100644 --- a/src/styles/sass/ads-sass/abstract-page-widgets.scss +++ b/src/styles/sass/ads-sass/abstract-page-widgets.scss @@ -327,3 +327,19 @@ $sciencewise-color: rgb(179, 27, 27); } } } + +.copy-btn { + text-decoration: none !important; + + &:any-link { + text-decoration: none !important; + } + + &:hover::after { + font-family: 'FontAwesome'; + content: '\f0ea'; + text-decoration: inherit; + color: black; + margin-left: 3px; + } +}