#246 옵션추가 버튼 제거 및 관련 스크립트 수정

This commit is contained in:
chicpro
2013-06-25 11:54:41 +09:00
parent b81002cc24
commit 35f5ffbdf2
5 changed files with 50 additions and 23 deletions

View File

@ -1,5 +1,27 @@
var option_add = false;
var supply_add = false;
$(function() {
// 선택옵션
$("select[name='it_option[]']").live("keydown", function(e) {
var sel_count = $("select[name='it_option[]']").size();
var idx = $("select[name='it_option[]']").index($(this));
var code = e.keyCode;
var val = $(this).val();
option_add = false;
if(code == 13 && sel_count == idx + 1) {
if(val == "")
return;
sel_option_process(true);
}
});
$("select[name='it_option[]']").live("mousedown", function() {
option_add = true;
});
$("select[name='it_option[]']").live("change", function() {
var sel_count = $("select[name='it_option[]']").size();
var idx = $("select[name='it_option[]']").index($(this));
@ -44,6 +66,9 @@ $(function() {
}
);
} else if((idx + 1) == sel_count) { // 선택옵션처리
if(option_add && val == "")
return;
var info = val.split(",");
// 재고체크
if(parseInt(info[2]) < 1) {
@ -51,27 +76,39 @@ $(function() {
return false;
}
// 선택옵션 자동추가 기능을 사용하려면 아래 false를 true로 설정
sel_option_process(false);
if(option_add)
sel_option_process(true);
}
});
// 추가옵션
$("select[name='it_supply[]']").live("keydown", function(e) {
var $el = $(this);
var code = e.keyCode;
var val = $(this).val();
supply_add = false;
if(code == 13) {
if(val == "")
return;
sel_supply_process($el, true);
}
});
$("select[name='it_supply[]']").live("mousedown", function() {
supply_add = true;
});
$("select[name='it_supply[]']").live("change", function() {
var $el = $(this);
// 선택옵션 자동추가 기능을 사용하려면 아래 false를 true로 설정
sel_supply_process($el, false);
});
var val = $(this).val();
// 선택옵션 추가
$("#sit_selopt_submit").live("click", function() {
sel_option_process(true);
});
if(val == "")
return;
// 추가옵션 추가
$("button.sit_sel_submit").live("click", function() {
var $el = $(this).closest("td").find("select[name='it_supply[]']");
sel_supply_process($el, true);
if(supply_add)
sel_supply_process($el, true);
});
// 수량변경 및 삭제

View File

@ -705,7 +705,6 @@ function get_item_supply($it_id, $subject)
}
}
$select .= '</select>'.PHP_EOL;
$select .= '<button type="button" id="sit_sel_submit_'.$i.'" class="btn_frmline sit_sel_submit">추가</button>'.PHP_EOL;
$str .= '<td class="td_sit_sel">'.$select.'</td>'.PHP_EOL;
$str .= '</tr>'.PHP_EOL;

View File

@ -378,9 +378,6 @@ else
?>
</tbody>
</table>
<div class="sit_sel_btn">
<button type="button" id="sit_selopt_submit" class="btn_frmline">추가</button>
</div>
</section>
<?php
}

View File

@ -53,9 +53,6 @@ if($option_1) {
?>
</tbody>
</table>
<div class="sit_sel_btn">
<button type="button" id="sit_selopt_submit" class="btn_frmline">추가</button>
</div>
</section>
<?php
}

View File

@ -369,9 +369,6 @@ else
?>
</tbody>
</table>
<div class="sit_sel_btn">
<button type="button" id="sit_selopt_submit" class="btn_frmline">추가</button>
</div>
</section>
<?php
}