yummy-guide-generic-administrate 0.8.9 → 0.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8c30d8690fff8a7358f89a9e8e56a651b9b7630e3d1e69237325a215e0e7a3f0
|
|
4
|
+
data.tar.gz: 488e2ad28e15eec00b0e8387734c1cdf5bd56426ba9f916fe611c03a700203aa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d95722f019bf3930435bd7602d9d937cf744bfa3b261fa771412f17f6b0ca047959bd3212af6cdd9b0c81992872f019ced8d79671e6fdbe38cb093084f227b78
|
|
7
|
+
data.tar.gz: a0afec4d0c4f2c8615664eea22ca12ef10e5332a70062cde6f535e4a4b251df567c0950e5056a5ea209cd3d3393e73f8b7f2f834056a78b1177ce38744f220a5
|
|
@@ -394,14 +394,6 @@
|
|
|
394
394
|
return tables;
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
function shouldInitializeForAddedNode(node) {
|
|
398
|
-
if (!node.matches) return false;
|
|
399
|
-
if (node.matches(TABLE_SELECTOR) || (node.querySelector && node.querySelector(TABLE_SELECTOR))) return true;
|
|
400
|
-
if (!node.closest || !node.closest(TABLE_SELECTOR)) return false;
|
|
401
|
-
|
|
402
|
-
return !!node.closest('thead') || node.matches('colgroup, col');
|
|
403
|
-
}
|
|
404
|
-
|
|
405
397
|
function allTrackedTables() {
|
|
406
398
|
return Array.from(document.querySelectorAll(TABLE_SELECTOR));
|
|
407
399
|
}
|
|
@@ -1040,29 +1032,6 @@
|
|
|
1040
1032
|
document.addEventListener('turbo:load', initializeFromDocument);
|
|
1041
1033
|
window.addEventListener('resize', initializeFromDocument);
|
|
1042
1034
|
|
|
1043
|
-
if (window.MutationObserver) {
|
|
1044
|
-
var mutationObserver = new MutationObserver(function(mutations) {
|
|
1045
|
-
mutations.forEach(function(mutation) {
|
|
1046
|
-
mutation.addedNodes.forEach(function(node) {
|
|
1047
|
-
if (node.nodeType !== Node.ELEMENT_NODE) return;
|
|
1048
|
-
if (!shouldInitializeForAddedNode(node)) return;
|
|
1049
|
-
|
|
1050
|
-
initializeColumnResizer(node);
|
|
1051
|
-
refreshStickyHeaderLayout(node);
|
|
1052
|
-
});
|
|
1053
|
-
|
|
1054
|
-
if (mutation.target && mutation.target.nodeType === Node.ELEMENT_NODE) {
|
|
1055
|
-
refreshStickyHeaderLayout(mutation.target);
|
|
1056
|
-
}
|
|
1057
|
-
});
|
|
1058
|
-
});
|
|
1059
|
-
|
|
1060
|
-
mutationObserver.observe(document.documentElement, {
|
|
1061
|
-
childList: true,
|
|
1062
|
-
subtree: true
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
1035
|
window.YummyGuideAdministrateColumnResizer = {
|
|
1067
1036
|
refreshStickyHeaderLayout: refreshStickyHeaderLayout
|
|
1068
1037
|
};
|
|
@@ -230,6 +230,14 @@ RSpec.describe "column resizer assets" do
|
|
|
230
230
|
expect(components_source).not_to include("table-with-fixed-header")
|
|
231
231
|
end
|
|
232
232
|
|
|
233
|
+
# document全体のDOM変更監視と一時切り分け用パラメータが残っていないことを静的に確認する
|
|
234
|
+
it "does not observe document mutations during table initialization" do
|
|
235
|
+
expect(javascript_source).not_to include("new MutationObserver")
|
|
236
|
+
expect(javascript_source).not_to include("mutationObserver.observe(document.documentElement")
|
|
237
|
+
expect(javascript_source).not_to include("admin_column_resizer_disable")
|
|
238
|
+
expect(javascript_source).not_to include("probeFeatureDisabled")
|
|
239
|
+
end
|
|
240
|
+
|
|
233
241
|
# 幅リセット時も固定列のCSS変数を再計算することを静的に確認する
|
|
234
242
|
it "recalculates CSS sticky-left offsets after clearing a column width" do
|
|
235
243
|
expect(javascript_source).to include("clearColumnWidth(columnId, key)")
|