We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bf2042-portal-extensions-init
BF2042-Portal-Extensions/src/web/app.js
Lines 1208 to 1220 in 36e2ae2
This is happening because the workspace now has its own instance and does not use the global Workspace class
one hacky solution is to use mutationObserver As I do in cool-plugins
mutationObserver
function hookWorkspaceSvg() { if(!_Blockly.getMainWorkspace()){ setTimeout(hookWorkspaceSvg, 100); return; } setTimeout( function(){ initializeWorkspaceEvents(); BF2042Portal.Plugins.initializeWorkspace(); }, 2000 ) if(!blocklyMutationObserver ){ const rulesApp = document.getElementsByTagName('app-rules')[0] blocklyMutationObserver = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { if (mutation.type === "childList") { if (!document.getElementsByTagName("app-blockly").length) { blocklyLoaded = false } else { if(!blocklyLoaded){ setTimeout( function(){ initializeWorkspaceEvents(); BF2042Portal.Plugins.initializeWorkspace(); blocklyLoaded = true; }, 100 ) } } } }); }); blocklyMutationObserver.observe(rulesApp, { attributes: false, childList: true, characterData: false }); } }
This adds two new variables to track the state of blockly rules
The text was updated successfully, but these errors were encountered:
fix: use mutation oberver to track if blockly is recreated and fire t…
6e39517
…he init events; fixes LennardF1989#29
Closing this as it's tracked by #27 and should be fixed with 2.0.0-pr.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
BF2042-Portal-Extensions/src/web/app.js
Lines 1208 to 1220 in 36e2ae2
This is happening because the workspace now has its own instance and does not use the global Workspace class
one hacky solution is to use
mutationObserver
As I do in cool-pluginsThis adds two new variables to track the state of blockly rules
The text was updated successfully, but these errors were encountered: