|
@@ -103,24 +103,25 @@ $( function(){
|
|
|
|
|
|
$( "#locationList" ).on( "change", function(){
|
|
|
setCenterType( $("input[name='centerType']:checked").val() );
|
|
|
+
|
|
|
+ var type = $("input[name='centerType']:checked").val();
|
|
|
|
|
|
if($('#locationList > option:selected').val() != "0") {
|
|
|
// $('#centerDiv').css("display", "block");
|
|
|
-
|
|
|
$( "#centerList option:not([value='0'])" ).appendTo( "#hideList" );
|
|
|
|
|
|
- if ($( "#hideList option[accessKey='"+$('#locationList').val()+"']" ).length == 0) {
|
|
|
+ if ($( "#hideList option[data-center-type='" + type +"'][accessKey='"+$('#locationList').val()+"']" ).length == 0) {
|
|
|
$("#centerLabel").text('<spring:message code="login.required.noCenter" />');
|
|
|
// var option = "<option value='99' selected>등록된 생활치료센터가 없습니다.</option>";
|
|
|
// $('#centerList').append(option);
|
|
|
} else {
|
|
|
$("#centerLabel").text('<spring:message code="login.required.selectCenter" />');
|
|
|
- $( "#hideList option[accessKey='"+$('#locationList').val()+"']" ).appendTo( "#centerList" );
|
|
|
+ $( "#hideList option[data-center-type='" + type +"'][accessKey='"+$('#locationList').val()+"']" ).appendTo( "#centerList" );
|
|
|
$("#centerList").val("0").prop("selected", true);
|
|
|
}
|
|
|
} else {
|
|
|
$( "#centerList option:not([value='0'])" ).appendTo( "#hideList" );
|
|
|
- $( "#hideList option" ).appendTo( "#centerList" );
|
|
|
+ $( "#hideList option[data-center-type='" + type +"']" ).appendTo( "#centerList" );
|
|
|
$("#centerLabel").text('<spring:message code="login.required.selectCenter" />');
|
|
|
}
|
|
|
});
|
|
@@ -151,7 +152,9 @@ $( function(){
|
|
|
|
|
|
function setCenterType( type ){
|
|
|
$( "#centerList option:not([value='0'])" ).appendTo( "#hideList2" );
|
|
|
- $( "#hideList option[data-center-type='"+type+"'], #hideList2 option[data-center-type='"+type+"']" ).appendTo( "#centerList" );
|
|
|
+ console.log( " type :::: " + type );
|
|
|
+ $( "#hideList option[data-center-type='"+type+"']").appendTo("#centerList");
|
|
|
+ $( "#hideList2 option[data-center-type='"+type+"']" ).appendTo( "#centerList" );
|
|
|
$("#centerList").val("0").prop("selected", true);
|
|
|
|
|
|
if( type == 'C' ) {
|