From da86f47dde97cee129735dd80ee952cd0f75aa52 Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 12 Apr 2019 11:18:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9populate=E7=9A=84=E6=97=B6=E5=80=99=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/ui/ModernUIPane.java | 10 ++++------ .../main/resources/com/fr/design/ui/InitNameSpace.js | 6 +++--- .../src/test/resources/com/fr/design/ui/demo.html | 6 ++++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java index 7d55666621..0198ebfe7c 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java @@ -105,13 +105,11 @@ public class ModernUIPane extends BasicPane { public void populate(final T t) { - browser.addLoadListener(new LoadAdapter() { + browser.addScriptContextListener(new ScriptContextAdapter() { @Override - public void onFinishLoadingFrame(FinishLoadingEvent event) { - if (event.isMainFrame()) { - JSValue ns = event.getBrowser().executeJavaScriptAndReturnValue("window." + namespace); - ns.asObject().setProperty(variable, t); - } + public void onScriptContextCreated(ScriptContextEvent event) { + JSValue ns = event.getBrowser().executeJavaScriptAndReturnValue("window." + namespace); + ns.asObject().setProperty(variable, t); } }); } diff --git a/designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js b/designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js index 0274d5fa50..03b2bb32ae 100644 --- a/designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js +++ b/designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js @@ -1,6 +1,6 @@ -var arr ="%s".split(".").reverse(); -var create = function (obj, names) { - var name = names.pop(); +let arr ="%s".split(".").reverse(); +let create = function (obj, names) { + let name = names.pop(); if (!name) { return; } diff --git a/designer-base/src/test/resources/com/fr/design/ui/demo.html b/designer-base/src/test/resources/com/fr/design/ui/demo.html index 2beae25a78..9e5211c89e 100644 --- a/designer-base/src/test/resources/com/fr/design/ui/demo.html +++ b/designer-base/src/test/resources/com/fr/design/ui/demo.html @@ -10,6 +10,12 @@ return Pool.data; }; +
测试页面,请点击最下面的按钮