diff --git a/client/galaxy/scripts/mvc/ui/ui-thumbnails.js b/client/galaxy/scripts/mvc/ui/ui-thumbnails.js index 0579b8c7c44..6d7e4491d98 100644 --- a/client/galaxy/scripts/mvc/ui/ui-thumbnails.js +++ b/client/galaxy/scripts/mvc/ui/ui-thumbnails.js @@ -1,8 +1,7 @@ /** This class renders the selection grid. */ import Utils from "utils/utils"; import Tabs from "mvc/ui/ui-tabs"; - -export var View = Backbone.View.extend({ +var View = Backbone.View.extend({ events: { "click .ui-thumbnails-item": "_onclick", "dblclick .ui-thumbnails-item": "_ondblclick" @@ -21,15 +20,17 @@ export var View = Backbone.View.extend({ render: function() { this.first = null; this.tabs.delAll(); - this._renderDefault(); + this._renderRegular(); this._renderList(); }, - _renderDefault: function() { + _renderRegular: function() { + var self = this; + var index = []; var title_length = 20; var $el = $("
").addClass("ui-thumbnails-grid"); this.collection.each(model => { - if (model.get("keywords").indexOf("default") !== -1) { + if (model.get("regular")) { var title = model.get("title"); $el.append( $( @@ -103,27 +104,22 @@ export var View = Backbone.View.extend({ } }, + /** Image/Icon template */ + _templateImage: function(options) { + if (options.image_src) { + return ``; + } + return `
`; + }, + /* Thumbnail template with image */ _templateThumbnailItem: function(options) { - return `
${ - options.title - }
`; + return `
${this._templateImage(options)}
${options.title}
`; }, /* Thumbnail template with image and description */ _templateRegularItem: function(options) { - return `
`; + return `
${ - options.title - }
${options.description}
`; } }); - -export default { View: View }; +export default { View: View }; \ No newline at end of file
${this._templateImage(options)}
${options.title}
${options.description}