24 lines
745 B
JavaScript
24 lines
745 B
JavaScript
window.checkUnlink = function()
|
|
{
|
|
const $elem = $(this);
|
|
if($elem.prop('checked')) return true;
|
|
|
|
const productID = +$elem.val();
|
|
if(unmodifiableProducts.includes(productID))
|
|
{
|
|
const $branch = $elem.closest('.product-block').find('[name^=branch]');
|
|
if($branch.length)
|
|
{
|
|
const branchID = +$branch.val();
|
|
if(unmodifiableBranches.includes(branchID) && linkedStoryIDList[productID][branchID])
|
|
{
|
|
zui.Modal.alert(unLinkProductTip.replace("%s", allProducts[productID] + branchGroups[productID][branchID]));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
zui.Modal.alert(unLinkProductTip.replace("%s", allProducts[productID]));
|
|
}
|
|
}
|
|
}
|