diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index c235a5032..a32cb5713 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -29,6 +29,8 @@ //= require nested_form_fields //= require highlight.pack //= require tinymce-jquery +//= require jsPlumb-2.0.4-min +//= require jsnetworkx //= require_directory ./sitewide //= require jquery.dataTables.yadcf //= require datatables diff --git a/app/assets/javascripts/experiments/dropdown_actions.js b/app/assets/javascripts/experiments/dropdown_actions.js index 7ba6fe909..b752370ee 100644 --- a/app/assets/javascripts/experiments/dropdown_actions.js +++ b/app/assets/javascripts/experiments/dropdown_actions.js @@ -25,6 +25,7 @@ }) .on("ajax:complete", function(){ animateSpinner(null, false); + $(id).find('.selectpicker').selectpicker(); }); } diff --git a/app/controllers/my_module_tags_controller.rb b/app/controllers/my_module_tags_controller.rb index 4703de1fc..7946f36dd 100644 --- a/app/controllers/my_module_tags_controller.rb +++ b/app/controllers/my_module_tags_controller.rb @@ -46,7 +46,7 @@ class MyModuleTagsController < ApplicationController respond_to do |format| format.json do - redirect_to my_module_tags_edit_path(format: :json), + redirect_to my_module_tags_edit_path(format: :json), turbolinks: false, status: 303 end end @@ -58,7 +58,7 @@ class MyModuleTagsController < ApplicationController respond_to do |format| format.json do - redirect_to my_module_tags_edit_path(format: :json), + redirect_to my_module_tags_edit_path(format: :json), turbolinks: false, status: 303 end end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 3a7eb04da..1df5da37e 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -35,9 +35,13 @@ class TagsController < ApplicationController flash[:success] = flash_success redirect_to session.delete(:return_to) } - format.json { - redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303 - } + format.json do + redirect_to my_module_tags_edit_path(params[:my_module_id], + @tag, + format: :json), + turbolinks: false, + status: 303 + end end else flash_error = t("tags.create.error_flash") @@ -46,10 +50,14 @@ class TagsController < ApplicationController flash[:error] = flash_error render :new } - format.json { + format.json do # TODO - redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303 - } + redirect_to my_module_tags_edit_path(params[:my_module_id], + @tag, + format: :json), + turbolinks: false, + status: 303 + end end end end @@ -59,9 +67,13 @@ class TagsController < ApplicationController if @tag.update_attributes(tag_params) respond_to do |format| format.html - format.json { - redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303 - } + format.json do + redirect_to my_module_tags_edit_path(params[:my_module_id], + @tag, + format: :json), + turbolinks: false, + status: 303 + end end else respond_to do |format| @@ -84,9 +96,13 @@ class TagsController < ApplicationController flash[:success] = flash_success redirect_to root_path } - format.json { - redirect_to my_module_tags_edit_path(params[:my_module_id], @tag, format: :json), :status => 303 - } + format.json do + redirect_to my_module_tags_edit_path(params[:my_module_id], + @tag, + format: :json), + turbolinks: false, + status: 303 + end end else flash_error = t( @@ -98,10 +114,12 @@ class TagsController < ApplicationController flash[:error] = flash_error redirect_to root_path } - format.json { + format.json do # TODO - redirect_to my_module_tags_edit_path(format: :json), :status => 303 - } + redirect_to my_module_tags_edit_path(format: :json), + turbolinks: false, + status: 303 + end end end end diff --git a/app/controllers/user_my_modules_controller.rb b/app/controllers/user_my_modules_controller.rb index 29701f721..e4555b71d 100644 --- a/app/controllers/user_my_modules_controller.rb +++ b/app/controllers/user_my_modules_controller.rb @@ -94,9 +94,11 @@ class UserMyModulesController < ApplicationController ) respond_to do |format| - format.json { - redirect_to my_module_users_edit_path(format: :json), :status => 303 - } + format.json do + redirect_to my_module_users_edit_path(format: :json), + turbolinks: false, + status: 303 + end end else respond_to do |format| diff --git a/app/controllers/user_projects_controller.rb b/app/controllers/user_projects_controller.rb index 7a912209f..779d2479d 100644 --- a/app/controllers/user_projects_controller.rb +++ b/app/controllers/user_projects_controller.rb @@ -66,9 +66,9 @@ class UserProjectsController < ApplicationController ) respond_to do |format| - format.json { - redirect_to :action => :index_edit, :format => :json - } + format.json do + redirect_to project_users_edit_path(format: :json), turbolinks: false + end end else error = t('user_projects.create.can_add_user_to_project') @@ -110,9 +110,9 @@ class UserProjectsController < ApplicationController ) respond_to do |format| - format.json { - redirect_to :action => :index_edit, :format => :json - } + format.json do + redirect_to project_users_edit_path(format: :json), turbolinks: false + end end else respond_to do |format| @@ -145,9 +145,11 @@ class UserProjectsController < ApplicationController generate_notification(current_user, @up.user, false, false, @project) respond_to do |format| - format.json { - redirect_to project_users_edit_path(format: :json), :status => 303 - } + format.json do + redirect_to project_users_edit_path(format: :json), + turbolinks: false, + status: 303 + end end else respond_to do |format| diff --git a/app/views/experiments/canvas.html.erb b/app/views/experiments/canvas.html.erb index ef6a09b04..279c5c3b6 100644 --- a/app/views/experiments/canvas.html.erb +++ b/app/views/experiments/canvas.html.erb @@ -65,8 +65,6 @@ <%= render partial: "my_modules/modals/manage_module_tags_modal", locals: { my_module: nil } %> -<%= javascript_include_tag("jsPlumb-2.0.4-min") %> -<%= javascript_include_tag("jsnetworkx") %> <%= javascript_include_tag("eventPause-min") %> <%= javascript_include_tag("projects/canvas") %>