@dotcms/uve 1.2.0 → 1.2.1
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.
- package/package.json +1 -1
- package/public.cjs.js +7 -3
- package/public.esm.js +7 -3
package/package.json
CHANGED
package/public.cjs.js
CHANGED
|
@@ -970,14 +970,18 @@ function listenBlockEditorInlineEvent() {
|
|
|
970
970
|
listenBlockEditorClick();
|
|
971
971
|
return {
|
|
972
972
|
destroyListenBlockEditorInlineEvent: () => {
|
|
973
|
-
|
|
973
|
+
// No need to remove listener if page was already loaded
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
976
|
}
|
|
977
|
-
|
|
977
|
+
// If the page is not fully loaded, listen for the DOMContentLoaded event
|
|
978
|
+
const handleDOMContentLoaded = () => {
|
|
979
|
+
listenBlockEditorClick();
|
|
980
|
+
};
|
|
981
|
+
document.addEventListener('DOMContentLoaded', handleDOMContentLoaded);
|
|
978
982
|
return {
|
|
979
983
|
destroyListenBlockEditorInlineEvent: () => {
|
|
980
|
-
|
|
984
|
+
document.removeEventListener('DOMContentLoaded', handleDOMContentLoaded);
|
|
981
985
|
}
|
|
982
986
|
};
|
|
983
987
|
}
|
package/public.esm.js
CHANGED
|
@@ -968,14 +968,18 @@ function listenBlockEditorInlineEvent() {
|
|
|
968
968
|
listenBlockEditorClick();
|
|
969
969
|
return {
|
|
970
970
|
destroyListenBlockEditorInlineEvent: () => {
|
|
971
|
-
|
|
971
|
+
// No need to remove listener if page was already loaded
|
|
972
972
|
}
|
|
973
973
|
};
|
|
974
974
|
}
|
|
975
|
-
|
|
975
|
+
// If the page is not fully loaded, listen for the DOMContentLoaded event
|
|
976
|
+
const handleDOMContentLoaded = () => {
|
|
977
|
+
listenBlockEditorClick();
|
|
978
|
+
};
|
|
979
|
+
document.addEventListener('DOMContentLoaded', handleDOMContentLoaded);
|
|
976
980
|
return {
|
|
977
981
|
destroyListenBlockEditorInlineEvent: () => {
|
|
978
|
-
|
|
982
|
+
document.removeEventListener('DOMContentLoaded', handleDOMContentLoaded);
|
|
979
983
|
}
|
|
980
984
|
};
|
|
981
985
|
}
|