From c1316a3bc145f75aab9238588dabd52aca249167 Mon Sep 17 00:00:00 2001 From: guerler Date: Wed, 1 May 2019 17:40:51 -0400 Subject: [PATCH] Fix dropdown templates in legacy popup-menu generators --- client/galaxy/scripts/mvc/ui/popup-menu.js | 33 ++++++++----------- .../galaxy/scripts/mvc/workflow/workflow.js | 2 +- client/galaxy/scripts/ui/popupmenu.js | 19 +++++------ client/galaxy/style/scss/base.scss | 2 +- 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/client/galaxy/scripts/mvc/ui/popup-menu.js b/client/galaxy/scripts/mvc/ui/popup-menu.js index 5e27f02dca1..e704cd5b0b0 100644 --- a/client/galaxy/scripts/mvc/ui/popup-menu.js +++ b/client/galaxy/scripts/mvc/ui/popup-menu.js @@ -53,7 +53,7 @@ var PopupMenu = Backbone.View.extend({ if (this.options.length) { var menu = this; //precondition: there should be one option per li - this.$el.find("li").each(function(i, li) { + this.$(".dropdown-item").each(function(i, li) { var option = menu.options[i]; // if the option has 'func', call that function when the anchor is clicked @@ -75,34 +75,29 @@ var PopupMenu = Backbone.View.extend({ }, template: function(id, options) { - return ['"].join(""); + return ``; }, _templateOptions: function(options) { if (!options.length) { - return "
  • (no options)
  • "; + return ''; } return _.map(options, option => { if (option.divider) { - return '
  • '; + return ''; } else if (option.header) { - return ['
  • ', option.html, "
  • "].join(""); + return ``; } var href = option.href || "javascript:void(0);"; - var target = option.target ? ` target="${option.target}"` : ""; - - var check = option.checked ? '' : ""; - - return [ - '
  • ", - check, - option.html, - "
  • " - ].join(""); + var target = option.target ? `target="${option.target}"` : ""; + var check = option.checked ? '' : ""; + return ` + ${check}${option.html} + `; }).join(""); }, diff --git a/client/galaxy/scripts/mvc/workflow/workflow.js b/client/galaxy/scripts/mvc/workflow/workflow.js index 1d9f42b8f8f..9530a6836f1 100644 --- a/client/galaxy/scripts/mvc/workflow/workflow.js +++ b/client/galaxy/scripts/mvc/workflow/workflow.js @@ -150,7 +150,7 @@ const WorkflowItemView = Backbone.View.extend({ /** Template for user actions for workflows */ _templateActions: function() { const Galaxy = getGalaxyInstance(); - if (this.model.get("owner") !== Galaxy.user.attributes.username) { + if (this.model.get("owner") == Galaxy.user.attributes.username) { return `