diff --git a/app/assets/javascripts/cancer_predict.js b/app/assets/javascripts/cancer_predict.js index 033118f..d1d3746 100644 --- a/app/assets/javascripts/cancer_predict.js +++ b/app/assets/javascripts/cancer_predict.js @@ -1 +1,18 @@ -$('.cancer_help_btn') \ No newline at end of file +$(document).ready(function(){ + $('.cancer_help_btn').append(''); + $('.cancer_help_btn').off("click").on('click',function(){ + var modal_head = ""; + try{ modal_head = $(this).parent().find(">label").html()}catch{}; + var modal_body = ""; + try{ modal_body = $(this).parent().find(">input.help_texts").attr('value')}catch{}; + $('#show_help_modal').html("") + $('#show_help_modal').modal('show'); + $('#show_help_modal .close').off("click").on('click',function(){ + $('#show_help_modal').modal('hide'); + }); + $('#show_help_modal .modal-footer button').off("click").on('click',function(){ + $('#show_help_modal').modal('hide'); + }); + }); +}); diff --git a/app/controllers/cancerpredicts_controller.rb b/app/controllers/cancerpredicts_controller.rb index e17d328..cecbdd3 100644 --- a/app/controllers/cancerpredicts_controller.rb +++ b/app/controllers/cancerpredicts_controller.rb @@ -11,7 +11,7 @@ class CancerpredictsController < ApplicationController tags = OrbitHelper.widget_tags categories = OrbitHelper.widget_categories || [] locale = OrbitHelper.get_site_locale.to_s - @table_str = '
' + @table_str = '
' create_first_field @form_to_show.form_show.each do |num,property| @table_str += '
' @@ -26,18 +26,21 @@ class CancerpredictsController < ApplicationController @field_property[key] = @disp_value end break if @field_property["name"] == "" - @table_str += '