From edce128e6b4f0cd0265a63bb1a60db38699f3428 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 25 Apr 2014 14:49:48 +0800 Subject: [PATCH 1/5] leanmodal --- app/views/my/account.html.erb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index bec07145b..9bc4cb2b5 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -3,8 +3,8 @@ @@ -13,6 +13,7 @@ @@ -19,11 +21,11 @@ url :'/school/get_options/'+encodeURIComponent(value), data :'text', success: function(data){ - - $("#schoollist").html(data); - - } + }, + complete: function() { + $("#province option").attr("disabled", true); + } } @@ -117,7 +119,7 @@ <% else %> - <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %> + <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), onclick: '$("#province option").attr("disabled", false)' %> From 12c19e2bfe2554ce5a749a969ebe7fef37992824 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 25 Apr 2014 15:41:12 +0800 Subject: [PATCH 3/5] =?UTF-8?q?Revert=20"jquery=20=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E7=9C=81=E4=BB=BD=E5=87=BA=E5=AD=A6=E6=A0=A1"=20revert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 891fa65c160652b6b47064fc738fe2e13a571cca. --- app/views/my/account.html.erb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 6efd76e15..9bc4cb2b5 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -5,8 +5,6 @@ function(){ $("#province_lean").attr("href", "#WOpenWindow") $("#province_lean").leanModal({top: 100, closeButton: ".modal_close"}); - $("#province option").attr("disabled", true); - $("#province option").click(function(){get_options(this.value);}); } ); @@ -21,11 +19,11 @@ url :'/school/get_options/'+encodeURIComponent(value), data :'text', success: function(data){ + + $("#schoollist").html(data); - }, - complete: function() { - $("#province option").attr("disabled", true); - } + + } } @@ -119,7 +117,7 @@ <% else %> - <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), onclick: '$("#province option").attr("disabled", false)' %> + <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %> From 230b377cad7af24cee323745b292efdedb353e35 Mon Sep 17 00:00:00 2001 From: yanxd Date: Fri, 25 Apr 2014 15:41:40 +0800 Subject: [PATCH 4/5] oRevert "leanmodal" oik This reverts commit edce128e6b4f0cd0265a63bb1a60db38699f3428. --- app/views/my/account.html.erb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 9bc4cb2b5..bec07145b 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -3,8 +3,8 @@ @@ -13,7 +13,6 @@