This is an automated email from the ASF dual-hosted git repository.
wangzx pushed a commit to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git
The following commit(s) were added to refs/heads/gh-pages by this push:
new db9ebe78 fix(editor): revert jQuery reuse (due to $.getScript window
context) (007749385bfcc99266c25d5401691f5be2f5a629)
db9ebe78 is described below
commit db9ebe78879099ca2f92a51a16d41f37418a8b1a
Author: plainheart <[email protected]>
AuthorDate: Wed Oct 18 17:08:29 2023 +0800
fix(editor): revert jQuery reuse (due to $.getScript window context)
(007749385bfcc99266c25d5401691f5be2f5a629)
---
src/editor/sandbox/index.js | 30 +++++-------------------------
1 file changed, 5 insertions(+), 25 deletions(-)
diff --git a/src/editor/sandbox/index.js b/src/editor/sandbox/index.js
index 6019cffa..91ff2eaa 100644
--- a/src/editor/sandbox/index.js
+++ b/src/editor/sandbox/index.js
@@ -32,31 +32,11 @@ export function createSandbox(
onOptionUpdated,
onCSSParsed
) {
- const commonLibs = [SCRIPT_URLS.seedrandomJS, SCRIPT_URLS.acornJS].map(
- (src) => ({ src })
- );
- commonLibs.unshift({
- content: `
- (() => {
- let _win = window;
- while (_win) {
- if (_win.jQuery) {
- if (_win !== window) {
- window.jQuery = window.$ = _win.jQuery;
- }
- return;
- }
- if (_win === top) {
- break;
- }
- _win = _win.parent;
- }
- const jqLib = document.createElement('script');
- jqLib.src = '${SCRIPT_URLS.jQueryJS}';
- document.head.appendChild(jqLib);
- })();
- `
- });
+ const commonLibs = [
+ SCRIPT_URLS.jQueryJS,
+ SCRIPT_URLS.seedrandomJS,
+ SCRIPT_URLS.acornJS
+ ].map((src) => ({ src }));
scripts = commonLibs.concat(scripts, prepareSetupScript(isShared));
const sandbox = document.createElement('iframe');
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]