Better MutationObserver for Cat and Tag

This commit is contained in:
LebCit
2018-12-04 00:21:09 +02:00
parent 84b55644d3
commit 0b8edf86c6
+2 -4
View File
@@ -44,8 +44,7 @@ jQuery(document).ready(function ($) {
function callbackCategory(mutationList) {
mutationList.forEach(function (mutation) {
if (mutation.type == 'childList') {
var $length = targetNodeCat.children().length;
if ($length == 5) {
if (mutation.target.childNodes.length == 1) {
targetNodeCat.append(fsmsp_cp.fsmsp_category_icon);
}
}
@@ -61,8 +60,7 @@ jQuery(document).ready(function ($) {
function callbackTag(mutationList) {
mutationList.forEach(function (mutation) {
if (mutation.type == 'childList') {
var $length = targetNodeTag.children().length;
if ($length == 5) {
if (mutation.target.childNodes.length == 1) {
targetNodeTag.append(fsmsp_cp.fsmsp_tag_icon);
}
}