Update dev-tools.js
Browse files- dev-tools.js +12 -36
dev-tools.js
CHANGED
@@ -1747,42 +1747,18 @@
|
|
1747 |
}
|
1748 |
}
|
1749 |
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
container.insertBefore(tree, container.querySelector('.dt-css-panel'));
|
1763 |
-
}
|
1764 |
-
}
|
1765 |
-
}
|
1766 |
-
|
1767 |
-
if (!tree) return;
|
1768 |
-
|
1769 |
-
tree.innerHTML = '';
|
1770 |
-
buildDOMTree(document.documentElement, tree, 0, true);
|
1771 |
-
|
1772 |
-
if (dtSelectedElement) {
|
1773 |
-
const elementId = dtSelectedElement.id || Array.from(dtSelectedElement.attributes)
|
1774 |
-
.find(attr => attr.name.startsWith('data-element-id'))?.value;
|
1775 |
-
|
1776 |
-
if (elementId) {
|
1777 |
-
const node = document.querySelector(`[data-element-id="${elementId}"]`);
|
1778 |
-
if (node) {
|
1779 |
-
node.classList.add('selected');
|
1780 |
-
updateCSSPanel(dtSelectedElement);
|
1781 |
-
}
|
1782 |
-
}
|
1783 |
-
}
|
1784 |
-
};
|
1785 |
-
|
1786 |
// MutationObserverの設定
|
1787 |
setupMutationObserver();
|
1788 |
|
|
|
1747 |
}
|
1748 |
}
|
1749 |
|
1750 |
+
let isRefreshing = false;
|
1751 |
+
dtRefreshElementsPanel = function() {
|
1752 |
+
if (isRefreshing) return;
|
1753 |
+
isRefreshing = true;
|
1754 |
+
|
1755 |
+
requestAnimationFrame(() => {
|
1756 |
+
let tree = document.getElementById('dt-dom-tree');
|
1757 |
+
tree.innerHTML = '';
|
1758 |
+
buildDOMTree(document.documentElement, tree, 0, true);
|
1759 |
+
isRefreshing = false;
|
1760 |
+
});
|
1761 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1762 |
// MutationObserverの設定
|
1763 |
setupMutationObserver();
|
1764 |
|