From 787b9af4293ed573b2db829a2ddd2c5f3b78882a Mon Sep 17 00:00:00 2001 From: cxt Date: Sat, 24 Oct 2015 10:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BD=9C=E4=B8=9A=E6=97=B6?= =?UTF-8?q?=E9=80=89=E4=B8=8D=E4=BA=86=E8=B5=84=E6=BA=90=E5=BA=93=E8=B5=84?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_show_user_resource.html.erb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/views/users/_show_user_resource.html.erb b/app/views/users/_show_user_resource.html.erb index 6d985687c..6c3216f11 100644 --- a/app/views/users/_show_user_resource.html.erb +++ b/app/views/users/_show_user_resource.html.erb @@ -16,6 +16,19 @@ $(this).addClass("referenceTypeActive"); }); }); + +// 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去 +function store_seleted_resource(dom){ + if(dom.attr('checked') == 'checked' ){ + $.get( + '<%= store_selected_resource_user_path %>'+'?save=y&res_id='+dom.val() + ) + }else { + $.get( + '<%= store_selected_resource_user_path %>'+'?save=n&res_id='+dom.val() + ) + } +}