diff --git a/client/galaxy/scripts/mvc/library/library-librarylist-view.js b/client/galaxy/scripts/mvc/library/library-librarylist-view.js index d2078ae7c68..0501960136f 100644 --- a/client/galaxy/scripts/mvc/library/library-librarylist-view.js +++ b/client/galaxy/scripts/mvc/library/library-librarylist-view.js @@ -5,6 +5,9 @@ import { getGalaxyInstance } from "app"; import { Toast } from "ui/toast"; import mod_library_model from "mvc/library/library-model"; import mod_library_libraryrow_view from "mvc/library/library-libraryrow-view"; +import linkifyJq from 'linkifyjs/jquery'; + +linkifyJq($, document); var LibraryListView = Backbone.View.extend({ el: "#libraries_element", @@ -129,8 +132,13 @@ var LibraryListView = Backbone.View.extend({ ); Galaxy.libraries.libraryToolbarView.renderPaginator(this.options); } - $('#center [data-toggle="tooltip"]').tooltip({ trigger: "hover" }); - $("#center").css("overflow", "auto"); + const $center_tooltip_el = $('#center [data-toggle="tooltip"]'); + if (!$center_tooltip_el.attr('title')) { + $center_tooltip_el.tooltip({trigger: "hover"}); + $("#center").css("overflow", "auto"); + } + // linkify description + $('[description=true]').linkify(); }, fetchDeleted: function () { diff --git a/client/galaxy/scripts/mvc/library/library-libraryrow-view.js b/client/galaxy/scripts/mvc/library/library-libraryrow-view.js index 97833b988b2..aa927eff759 100644 --- a/client/galaxy/scripts/mvc/library/library-libraryrow-view.js +++ b/client/galaxy/scripts/mvc/library/library-libraryrow-view.js @@ -4,6 +4,7 @@ import Backbone from "backbone"; import { Toast } from "ui/toast"; import { getGalaxyInstance } from "app"; + // galaxy library row view var LibraryRowView = Backbone.View.extend({ events: { @@ -38,6 +39,7 @@ var LibraryRowView = Backbone.View.extend({ } this.prepareButtons(library); var tmpl = this.templateRow(); + this.setElement( tmpl({ library: library, @@ -46,6 +48,7 @@ var LibraryRowView = Backbone.View.extend({ }) ); this.$el.show(); + return this; }, @@ -62,6 +65,9 @@ var LibraryRowView = Backbone.View.extend({ old_element.replaceWith(this.$el); /* now we attach new tooltips to the newly created row element */ this.$el.find('[data-toggle="tooltip"]').tooltip({ trigger: "hover" }); + + // linkify new description, after its change + $('[description=true]').linkify(); }, /** @@ -244,12 +250,12 @@ var LibraryRowView = Backbone.View.extend({ <% } %> <% if(library.get("description")) { %> <% if( (library.get("description")).length> 40 ) { %> - "> <%= _.escape(library.get("description")).substring(0, 40) + "..." %> <% } else { %> - <%= _.escape(library.get("description"))%> + <%= _.escape(library.get("description"))%> <% } %> <% } else { %> diff --git a/client/package.json b/client/package.json index c21d3fbd566..e6fa546d4f8 100644 --- a/client/package.json +++ b/client/package.json @@ -40,6 +40,7 @@ "jquery.cookie": "^1.4.1", "latex-parser": "^0.6.2", "latex-to-unicode-converter": "^0.5.2", + "linkifyjs": "^2.1.9", "markdown-it": "^8.4.2", "moment": "2.24.0", "popper.js": "^1.16.1", diff --git a/client/yarn.lock b/client/yarn.lock index c40f173f72b..d82e3608ed2 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -8341,6 +8341,11 @@ linkify-it@^2.0.0: dependencies: uc.micro "^1.0.1" +linkifyjs@^2.1.9: + version "2.1.9" + resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-2.1.9.tgz#af06e45a2866ff06c4766582590d098a4d584702" + integrity sha512-74ivurkK6WHvHFozVaGtQWV38FzBwSTGNmJolEgFp7QgR2bl6ArUWlvT4GcHKbPe1z3nWYi+VUdDZk16zDOVug== + listify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/listify/-/listify-1.0.0.tgz#03ca7ba2d150d4267773f74e57558d1053d2bee3"