* Code for langitems js refactors.

This commit is contained in:
guofeilong
2023-02-16 08:41:08 +08:00
parent 8d3084c957
commit b2a664edf2
+17 -15
View File
@@ -1,27 +1,17 @@
$(function()
{
$(".input-list").on("click", 'input', function(event)
$(".input-list").on("click", 'input', function(e)
{
addActive(event.target.id);
handleClickItem(e.target.id);
});
$(".input-list").on("blur", 'input', function(event)
$(".input-list").on("blur", 'input', function(e)
{
removeActive(event.target.id);
removeActive(e.target.id);
});
$('.label-list > .input-label').on('click', function(e)
{
var clearId = $('.label-list > .text-primary').attr('labelid');
var clickId = $(this).attr('labelid');
if(clearId && clearId !== clickId)
{
removeActive(clearId);
};
if(clickId && clickId != clearId)
{
addActive(clickId);
};
handleClickItem($(this).attr('labelid'));
});
function addActive(id)
@@ -36,5 +26,17 @@ $(function()
$('[iconid=' + id + ']').addClass('hidden');
}
function handleClickItem(clickId)
{
var clearId = $('.label-list > .text-primary').attr('labelid');
if(clearId && clearId !== clickId)
{
removeActive(clearId);
};
if(clickId && clickId != clearId)
{
addActive(clickId);
};
}
})