diff --git a/app/assets/javascripts/projects/show.js b/app/assets/javascripts/projects/show.js index 357c573e5..1fef0b09a 100644 --- a/app/assets/javascripts/projects/show.js +++ b/app/assets/javascripts/projects/show.js @@ -239,6 +239,17 @@ }); } + function initNewExperimentToolbarButton() { + let forms = '.new-experiment-form'; + $(experimentsPage) + .on('ajax:success', forms, function(ev, data) { + appendActionModal($(data.html)); + }) + .on('ajax:error', forms, function(ev, data) { + HelperModule.flashAlertMsg(data.responseJSON.message, 'danger'); + }); + } + function init() { $('.workflowimg-container').each(function() { let container = $(this); @@ -284,6 +295,7 @@ initExperimentsSelector(); initArchiveRestoreToolbarButtons(); initEditMoveDuplicateToolbarButton(); + initNewExperimentToolbarButton(); initSelectAllCheckbox(); } diff --git a/app/assets/stylesheets/experiments.scss b/app/assets/stylesheets/experiments.scss index 40f793f05..98bc4b117 100644 --- a/app/assets/stylesheets/experiments.scss +++ b/app/assets/stylesheets/experiments.scss @@ -36,6 +36,7 @@ .clone-experiments-form, .move-experiments-form, .archive-experiments-form, + .new-experiments-form, .restore-experiments-form { display: inline-block; } diff --git a/app/views/experiments/_move_modal.html.erb b/app/views/experiments/_move_modal.html.erb index c0cf7fafa..697d87e8a 100644 --- a/app/views/experiments/_move_modal.html.erb +++ b/app/views/experiments/_move_modal.html.erb @@ -1,11 +1,13 @@ -