From 818595a6a513df7a302c7f19b4e6f10a4b599c2d Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 3 Jul 2017 19:49:27 +0800 Subject: [PATCH] add --- bi/base.js | 4 ++-- bi/widget.js | 15 ++++++++++++--- docs/base.js | 4 ++-- docs/resource.css | 10 ++++++++++ docs/widget.js | 15 ++++++++++++--- src/base/table/native.scrollbar.js | 4 ++-- src/widget/arrangement/arrangement.js | 15 ++++++++++++--- 7 files changed, 52 insertions(+), 15 deletions(-) diff --git a/bi/base.js b/bi/base.js index 6b76de97e..7fd86def7 100644 --- a/bi/base.js +++ b/bi/base.js @@ -28705,7 +28705,7 @@ BI.NativeTableScrollbar = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; //把滚动台size改掉 - BI.GridTableScrollbar.SIZE = 16; + this.element.width(36); var throttle = BI.throttle(function () { self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollTop()); @@ -28781,7 +28781,7 @@ BI.NativeTableHorizontalScrollbar = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; //把滚动台size改掉 - BI.GridTableScrollbar.SIZE = 16; + this.element.height(36); var throttle = BI.throttle(function () { self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollLeft()); diff --git a/bi/widget.js b/bi/widget.js index f39e8eade..abf4b3ae1 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -983,9 +983,9 @@ BI.Arrangement = BI.inherit(BI.Widget, { case BI.Arrangement.LAYOUT_TYPE.FREE: return true; case BI.Arrangement.LAYOUT_TYPE.GRID: - if (this._isRegionOverlay()) { - return false; - } + // if (this._isRegionOverlay()) { + // return false; + // } } return true; }, @@ -1719,6 +1719,15 @@ BI.Arrangement = BI.inherit(BI.Widget, { region.width = region.width * xRatio; region.top = region.top * yRatio; region.height = region.height * yRatio; + //做一下自适应布局到网格布局的兼容 + var perWidth = this._getOneWidthPortion(); + var widthPortion = Math.round(region.width / perWidth); + var leftPortion = Math.round(region.left / perWidth); + var comparePortion = Math.round((region.width + region.left) / perWidth); + if (leftPortion + widthPortion !== comparePortion) { + region.left = leftPortion * perWidth; + region.width = comparePortion * perWidth - region.left; + } }); if (this._test(regions)) { var layout = this._getLayoutsByRegions(regions); diff --git a/docs/base.js b/docs/base.js index 6b76de97e..7fd86def7 100644 --- a/docs/base.js +++ b/docs/base.js @@ -28705,7 +28705,7 @@ BI.NativeTableScrollbar = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; //把滚动台size改掉 - BI.GridTableScrollbar.SIZE = 16; + this.element.width(36); var throttle = BI.throttle(function () { self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollTop()); @@ -28781,7 +28781,7 @@ BI.NativeTableHorizontalScrollbar = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; //把滚动台size改掉 - BI.GridTableScrollbar.SIZE = 16; + this.element.height(36); var throttle = BI.throttle(function () { self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollLeft()); diff --git a/docs/resource.css b/docs/resource.css index 394cd8231..dfc438363 100644 --- a/docs/resource.css +++ b/docs/resource.css @@ -122,6 +122,16 @@ textarea::-webkit-scrollbar-thumb:hover { _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='icon/loading.gif'); _background: none; } +.auto-color-background { + background: url('background/auto-color.png') no-repeat center center; + _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='background/auto-color.png'); + _background: none; +} +.trans-color-background { + background: url('background/trans-color.png') no-repeat center center; + _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='background/trans-color.png'); + _background: none; +} @font-face { font-family: 'bi'; src: url('font/iconfont.eot'), /* IE6-IE8 */ url('font/iconfont.woff') format('woff'), /* chrome、firefox */ url('font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('font/iconfont.svg#svgFontName') format('svg'); diff --git a/docs/widget.js b/docs/widget.js index f39e8eade..abf4b3ae1 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -983,9 +983,9 @@ BI.Arrangement = BI.inherit(BI.Widget, { case BI.Arrangement.LAYOUT_TYPE.FREE: return true; case BI.Arrangement.LAYOUT_TYPE.GRID: - if (this._isRegionOverlay()) { - return false; - } + // if (this._isRegionOverlay()) { + // return false; + // } } return true; }, @@ -1719,6 +1719,15 @@ BI.Arrangement = BI.inherit(BI.Widget, { region.width = region.width * xRatio; region.top = region.top * yRatio; region.height = region.height * yRatio; + //做一下自适应布局到网格布局的兼容 + var perWidth = this._getOneWidthPortion(); + var widthPortion = Math.round(region.width / perWidth); + var leftPortion = Math.round(region.left / perWidth); + var comparePortion = Math.round((region.width + region.left) / perWidth); + if (leftPortion + widthPortion !== comparePortion) { + region.left = leftPortion * perWidth; + region.width = comparePortion * perWidth - region.left; + } }); if (this._test(regions)) { var layout = this._getLayoutsByRegions(regions); diff --git a/src/base/table/native.scrollbar.js b/src/base/table/native.scrollbar.js index b584d2b3c..ac629be71 100644 --- a/src/base/table/native.scrollbar.js +++ b/src/base/table/native.scrollbar.js @@ -22,7 +22,7 @@ BI.NativeTableScrollbar = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; //把滚动台size改掉 - BI.GridTableScrollbar.SIZE = 16; + this.element.width(36); var throttle = BI.throttle(function () { self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollTop()); @@ -98,7 +98,7 @@ BI.NativeTableHorizontalScrollbar = BI.inherit(BI.Widget, { render: function () { var self = this, o = this.options; //把滚动台size改掉 - BI.GridTableScrollbar.SIZE = 16; + this.element.height(36); var throttle = BI.throttle(function () { self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollLeft()); diff --git a/src/widget/arrangement/arrangement.js b/src/widget/arrangement/arrangement.js index 2a3b271bc..662cf1b35 100644 --- a/src/widget/arrangement/arrangement.js +++ b/src/widget/arrangement/arrangement.js @@ -189,9 +189,9 @@ BI.Arrangement = BI.inherit(BI.Widget, { case BI.Arrangement.LAYOUT_TYPE.FREE: return true; case BI.Arrangement.LAYOUT_TYPE.GRID: - if (this._isRegionOverlay()) { - return false; - } + // if (this._isRegionOverlay()) { + // return false; + // } } return true; }, @@ -925,6 +925,15 @@ BI.Arrangement = BI.inherit(BI.Widget, { region.width = region.width * xRatio; region.top = region.top * yRatio; region.height = region.height * yRatio; + //做一下自适应布局到网格布局的兼容 + var perWidth = this._getOneWidthPortion(); + var widthPortion = Math.round(region.width / perWidth); + var leftPortion = Math.round(region.left / perWidth); + var comparePortion = Math.round((region.width + region.left) / perWidth); + if (leftPortion + widthPortion !== comparePortion) { + region.left = leftPortion * perWidth; + region.width = comparePortion * perWidth - region.left; + } }); if (this._test(regions)) { var layout = this._getLayoutsByRegions(regions);