* Code for langitems js refactors.
This commit is contained in:
+17
-15
@@ -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);
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user