Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/shiny-mugs-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@khanacademy/perseus": patch
"raphael": patch
---

DEBUG - Console messaages for debugging insertBefore error
2 changes: 2 additions & 0 deletions packages/perseus/src/interactive2/wrapped-drawing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export default abstract class WrappedDrawing {
toBack() {
const parentNode = this.wrapper.parentNode;
if (parentNode != null && parentNode.firstChild !== this.wrapper) {
// eslint-disable-next-line
console.log("*** insertBefore - wrapped-drawing.ts ***");
parentNode.insertBefore(this.wrapper, parentNode.firstChild);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const Indicator = (props: IndicatorProps) => {
onClick={handleClick}
>
{icon}
{content.visible}
<span>{content.visible}</span>
</button>
);
};
Expand Down
14 changes: 14 additions & 0 deletions vendor/raphael/raphael.js
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,8 @@ export default (function () {
return this;
}
if (this.node.parentNode.firstChild != this.node) {
// eslint-disable-next-line
console.log("*** insertBefore - raphael - 1 ***");
this.node.parentNode.insertBefore(this.node, this.node.parentNode.firstChild);
toback(this, this.paper);
var svg = this.paper;
Expand All @@ -1680,6 +1682,8 @@ export default (function () {
}
var node = element.node || element[element.length - 1].node;
if (node.nextSibling) {
// eslint-disable-next-line
console.log("*** insertBefore - raphael - 2 ***");
node.parentNode.insertBefore(this.node, node.nextSibling);
} else {
node.parentNode[appendChild](this.node);
Expand All @@ -1692,6 +1696,8 @@ export default (function () {
return this;
}
var node = element.node || element[0].node;
// eslint-disable-next-line
console.log("*** insertBefore - raphael - 3 ***");
node.parentNode.insertBefore(this.node, node);
insertbefore(this, element, this.paper);
return this;
Expand Down Expand Up @@ -1955,6 +1961,8 @@ export default (function () {
dstyle.left = 0;
dstyle.width = o.paper.width + "px";
dstyle.height = o.paper.height + "px";
// eslint-disable-next-line
console.log("*** insertBefore - raphael - 4 ***");
group.parentNode.insertBefore(div, group);
div[appendChild](group);
node.clipRect = div;
Expand Down Expand Up @@ -2398,6 +2406,8 @@ export default (function () {
return this;
}
if (this.Group.parentNode.firstChild != this.Group) {
// eslint-disable-next-line
console.log("*** insertBefore - raphael - 5 ***");
this.Group.parentNode.insertBefore(this.Group, this.Group.parentNode.firstChild);
toback(this, this.paper);
}
Expand All @@ -2411,6 +2421,8 @@ export default (function () {
element = element[element.length - 1];
}
if (element.Group.nextSibling) {
// eslint-disable-next-line
console.log("*** insertBefore - raphael - 6 ***");
element.Group.parentNode.insertBefore(this.Group, element.Group.nextSibling);
} else {
element.Group.parentNode[appendChild](this.Group);
Expand All @@ -2425,6 +2437,8 @@ export default (function () {
if (element.constructor == Set) {
element = element[0];
}
// eslint-disable-next-line
console.log("*** insertBefore - raphael - 7 ***");
element.Group.parentNode.insertBefore(this.Group, element.Group);
insertbefore(this, element, this.paper);
return this;
Expand Down
Loading