diff --git a/README.md b/README.md
index 6598ca6..c2eddfb 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,3 @@
# BI模板自适应插件
-用户查看模板时可以选择自适应屏幕宽度的查看方式。
-
-待解决问题:
-1. IE下图表的弹出框错位
\ No newline at end of file
+用户查看模板时可以选择自适应屏幕宽度的查看方式。
\ No newline at end of file
diff --git a/plugin.xml b/plugin.xml
index d4ce01a..fe840d4 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -3,7 +3,7 @@
com.finebi.plugin.screenadaptive
yes
- 1.1.30
+ 1.1.31
10.0
2019-03-01
fay
diff --git a/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js b/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
index 72abb68..39749e0 100644
--- a/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
+++ b/src/main/resources/com/finebi/plugin/web/plugin.screen_adaptive.js
@@ -91,13 +91,21 @@
// 获取缩放倍数,原模板宽高
function getScaleBounds() {
- var widgts = BI.designConfigure.widgets,
+ var widgets = BI.designConfigure.widgets,
layoutRatio = BI.designConfigure.layoutRatio,
freeLayoutRatio = BI.designConfigure.freeLayoutRatio,
freeWidgets = BI.designConfigure.freeWidgetIds;
+
+ if (Object.keys(widgets).length === 0) {
+ return {
+ scale: 1,
+ width: html.clientWidth,
+ height: html.clientHeight
+ }
+ }
var left = null, right = null, top = null, bottom = null,
freeLeft = null, freeRight = null, freeTop = null, freeBottom = null;
- BI.each(widgts, function (wId, widget) {
+ BI.each(widgets, function (wId, widget) {
var bounds = widget.bounds || {};
if (BI.contains(freeWidgets, wId)) {
freeLeft = BI.isNull(freeLeft) ? bounds.left : Math.min(freeLeft, bounds.left);
diff --git a/src/main/resources/com/finebi/plugin/web/scripts/entry.js b/src/main/resources/com/finebi/plugin/web/scripts/entry.js
index 72abb68..39749e0 100644
--- a/src/main/resources/com/finebi/plugin/web/scripts/entry.js
+++ b/src/main/resources/com/finebi/plugin/web/scripts/entry.js
@@ -91,13 +91,21 @@
// 获取缩放倍数,原模板宽高
function getScaleBounds() {
- var widgts = BI.designConfigure.widgets,
+ var widgets = BI.designConfigure.widgets,
layoutRatio = BI.designConfigure.layoutRatio,
freeLayoutRatio = BI.designConfigure.freeLayoutRatio,
freeWidgets = BI.designConfigure.freeWidgetIds;
+
+ if (Object.keys(widgets).length === 0) {
+ return {
+ scale: 1,
+ width: html.clientWidth,
+ height: html.clientHeight
+ }
+ }
var left = null, right = null, top = null, bottom = null,
freeLeft = null, freeRight = null, freeTop = null, freeBottom = null;
- BI.each(widgts, function (wId, widget) {
+ BI.each(widgets, function (wId, widget) {
var bounds = widget.bounds || {};
if (BI.contains(freeWidgets, wId)) {
freeLeft = BI.isNull(freeLeft) ? bounds.left : Math.min(freeLeft, bounds.left);