leanmodal

This commit is contained in:
yanxd 2014-04-25 14:49:48 +08:00
parent bac261047f
commit edce128e6b
1 changed files with 4 additions and 8 deletions

View File

@ -3,8 +3,8 @@
<script type="text/javascript">
$(document).ready(
function(){
$("#province").attr("href", "#WOpenWindow")
$("#province").leanModal({top: 100, closeButton: ".modal_close"});
$("#province_lean").attr("href", "#WOpenWindow")
$("#province_lean").leanModal({top: 100, closeButton: ".modal_close"});
}
);
</script>
@ -13,6 +13,7 @@
<script type="text/javascript">
function get_options(value){
$("#province_lean").click();
$.ajax({
type :"POST",
url :'/school/get_options/'+encodeURIComponent(value),
@ -109,23 +110,18 @@
<p style="width:357px;padding-left: 26px;">
<div class="hidden" id='province_lean' ></div>
<% unless User.current.user_extensions.school.nil? %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province, User.current.user_extensions.school.province), :onchange => "get_options(this.value)" %>
<input id="occupation" name="occupation" type="hidden" value="<%=User.current.user_extensions.school.id%>" />
<input id="occupation_name" type="text" value="<%=User.current.user_extensions.school.name%>" readonly />
<!--<%= select_tag "occupation",
options_for_select([[User.current.user_extensions.school.name, User.current.user_extensions.school.id]]) %>-->
<% else %>
<%= l(:field_occupation) %>&nbsp;<span class="required">*</span><%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %>
<input id="occupation" name="occupation" type="hidden" />
<input id="occupation_name" type="text" readonly />
<% end %>
<!-- <input id="occupation" readonly />-->
</p>
<div id="WOpenWindow">