subsub 2023-12-08
2023/12/08 선거문자 스크립트 수정
@b430b94e60c1218c1c0b1d582530f6f49dc2f6b0
src/main/webapp/publish/css/content.css
--- src/main/webapp/publish/css/content.css
+++ src/main/webapp/publish/css/content.css
@@ -628,7 +628,7 @@
 
 /* 2023/12/07 선거문자 - 20건문자(수동문자) 전송 추가 table에서 ul로 변경 */
 .sub .election .receipt_number_table_wrap .table_ul{display:flex;flex-wrap:wrap;text-align:center;align-content:flex-start;}
-.sub .election .receipt_number_table_wrap .table_ul li{position:relative;display:flex;border:0;background:transparent;justify-content:center;align-items:center;}
+.sub .election .receipt_number_table_wrap .table_ul li{position:relative;display:flex;border:0;background:transparent;justify-content:center;align-items:center;z-index:5;}
 .sub .election .receipt_number_table_wrap .table_ul li::after{position:absolute;content:"";width:1px;height:16px;background:#d4d4d4;right:0;top:50%;transform:translateY(-50%);}
 .sub .election .receipt_number_table_wrap .table_ul li:nth-child(2n)::after{display:none;}
 .sub .election .receipt_number_table_wrap .thead_ul li:nth-child(odd){width:60px;}
src/main/webapp/publish/sub_election_2023.html
--- src/main/webapp/publish/sub_election_2023.html
+++ src/main/webapp/publish/sub_election_2023.html
@@ -31,23 +31,27 @@
 	<script>
 		$(document).ready(function () {
 			$(".receipt_number_table_wrap .tbody_ul").selectable({
-				selecting: function (event, ui) {
-					$(ui.selecting).find("input[type='checkbox']").attr("checked", "checked");
-				},
-				selected: function (event, ui) {
-					if ($(ui.selected).find("input[type='checkbox']").attr("checked") == true) {
-						$(ui.selected).find("input[type='checkbox']").removeAttr("checked");
-					} else {
-						$(ui.selected).find("input[type='checkbox']").attr("checked", "checked");
-					}
-				},
-				unselecting: function (event, ui) {
-					$(ui.unselecting).find("input[type='checkbox']").removeAttr("checked");
-				},
-				unselected: function (event, ui) {
-					$(ui.unselected).find("input[type='checkbox']").removeAttr("checked");
-				},
-				filter: "li"
+				filter: "li",
+				stop: function () {
+					$(".ui-selected input",this).each(function () {
+						console.log("stop"+this);
+						this.checked = !this.checked;
+						if ($(this).is(':checked')) {
+							console.log($(this));
+							$(this).closest(".ui-widget-content").addClass("ui-selected");
+						} else {
+							$(this).closest(".ui-widget-content").removeClass("ui-selected");
+						}
+					});
+				}
+			});
+
+			$(".receipt_number_table_wrap .tbody_ul input[type='checkbox']",".receipt_number_table_wrap .tbody_ul input[type='checkbox']+label").click(function () {
+				if ($(this).is(':checked')) {
+					$(this).closest(".ui-widget-content").addClass("ui-selected");
+				} else {
+					$(this).closest(".ui-widget-content").removeClass("ui-selected");
+				}
 			});
 
 			onlongclick(".btn_check_one", 1000, function () {
Add a comment
List