Browse Source

IE8兼容

es6
guy 7 years ago
parent
commit
41b8edf812
  1. 4
      bi/base.css
  2. 160
      bi/base.js
  3. 35
      bi/core.js
  4. 24
      bi/widget.js
  5. 4
      docs/base.css
  6. 160
      docs/base.js
  7. 35
      docs/core.js
  8. 26
      docs/resource.css
  9. 24
      docs/widget.js
  10. 155
      src/base/table/native.scrollbar.js
  11. 6
      src/base/table/table.grid.scrollbar.js
  12. 15
      src/config.js
  13. 20
      src/core/base.js
  14. 4
      src/css/base/table/table.grid.scrollbar.css
  15. 26
      src/css/resource/app.css
  16. 4
      src/less/base/table/table.grid.scrollbar.less
  17. 51
      src/less/lib/colors.less
  18. 29
      src/less/lib/constant.less
  19. 27
      src/less/resource/app.less
  20. 12
      src/widget/sequencetable/listnumber.sequencetable.js
  21. 12
      src/widget/sequencetable/treenumber.sequencetable.js

4
bi/base.css

@ -1196,13 +1196,13 @@ li.CodeMirror-hint-active {
}
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
.public-scrollbar-face-active:after {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark .public-scrollbar-main:hover .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-main-active .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-faceActive:after {
.bi-theme-dark .public-scrollbar-face-active:after {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}

160
bi/base.js

@ -28225,6 +28225,160 @@ BI.Svg = BI.inherit(BI.Widget, {
}
});
BI.shortcut("bi.svg", BI.Svg);/**
*
* 原生表格滚动条为了IE8的兼容
*
* Created by GUY on 2016/1/12.
* @class BI.NativeTableScrollbar
* @extends BI.Widget
*/
BI.NativeTableScrollbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NativeTableScrollbar.superclass._defaultConfig.apply(this, arguments), {
attributes: {
tabIndex: 0
},
contentSize: 0,
defaultPosition: 0,
position: 0,
size: 0
})
},
render: function () {
var self = this, o = this.options;
//把滚动台size改掉
BI.GridTableScrollbar.SIZE = 16;
var throttle = BI.throttle(function () {
self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollTop());
}, 150, {leading: false});
this.element.scroll(function () {
throttle();
});
return {
type: "bi.default",
scrolly: true,
items: [{
type: "bi.layout",
width: 1,
ref: function (_ref) {
self.inner = _ref;
}
}]
}
},
mounted: function () {
this._populate();
},
_populate: function () {
var self = this, o = this.options;
if (o.size < 1 || o.contentSize <= o.size) {
this.setVisible(false);
return;
}
this.setVisible(true);
try {
this.element.scrollTop(o.position);
} catch (e) {
}
this.inner.element.height(o.contentSize);
},
setContentSize: function (contentSize) {
this.options.contentSize = contentSize;
},
setPosition: function (position) {
this.options.position = position;
},
setSize: function (size) {
this.setHeight(size);
this.options.size = size;
},
populate: function () {
this._populate();
}
});
BI.NativeTableScrollbar.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.native_table_scrollbar", BI.NativeTableScrollbar);
BI.NativeTableHorizontalScrollbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NativeTableHorizontalScrollbar.superclass._defaultConfig.apply(this, arguments), {
attributes: {
tabIndex: 0
},
contentSize: 0,
position: 0,
size: 0
})
},
render: function () {
var self = this, o = this.options;
//把滚动台size改掉
BI.GridTableScrollbar.SIZE = 16;
var throttle = BI.throttle(function () {
self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollLeft());
}, 150, {leading: false});
this.element.scroll(function () {
throttle();
});
return {
type: "bi.default",
scrollx: true,
items: [{
type: "bi.layout",
height: 1,
ref: function (_ref) {
self.inner = _ref;
}
}]
}
},
setContentSize: function (contentSize) {
this.options.contentSize = contentSize;
},
setPosition: function (position) {
this.options.position = position;
},
setSize: function (size) {
this.setWidth(size);
this.options.size = size;
},
_populate: function () {
var self = this, o = this.options;
if (o.size < 1 || o.contentSize <= o.size) {
this.setVisible(false);
return;
}
this.setVisible(true);
try {
this.element.scrollLeft(o.position);
} catch (e) {
}
this.inner.element.width(o.contentSize);
},
populate: function () {
this._populate();
}
});
BI.NativeTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.native_table_horizontal_scrollbar", BI.NativeTableHorizontalScrollbar);/**
*
* 表格
*
@ -29821,7 +29975,11 @@ BI.GridTableScrollbar = BI.inherit(BI.Widget, {
} else {
this._mouseMoveTracker.captureMouseMoves(e);
}
this.element[0].focus();
try {
this.element[0].focus();
} catch (e) {
}
},
_onMouseMove: function (deltaX, deltaY) {

35
bi/core.js

@ -2920,6 +2920,26 @@ if (!window.BI) {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
},
isIE9Below: function () {
if (!BI.isIE()) {
return false;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
if (v1 && v2 && v1[1] && v2[1]) {
version = Math.max(v1[1] * 1, v2[1] * 1);
} else if (v1 && v1[1]) {
version = v1[1] * 1;
} else if (v2 && v2[1]) {
version = v2[1] * 1;
} else {
version = 0;
}
return version < 9;
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},
@ -17811,6 +17831,21 @@ $(function () {
return ob;
}
});
//注册滚动条
BI.Plugin.registerWidget("bi.grid_table_scrollbar", function (ob) {
if (BI.isIE9Below()) {
return BI.extend(ob, {type: "bi.native_table_scrollbar"});
} else {
return ob;
}
});
BI.Plugin.registerWidget("bi.grid_table_horizontal_scrollbar", function (ob) {
if (BI.isIE9Below()) {
return BI.extend(ob, {type: "bi.native_table_horizontal_scrollbar"});
} else {
return ob;
}
});
//注册控件
BI.Plugin.registerWidget("bi.grid_table", function (ob) {

24
bi/widget.js

@ -178,7 +178,11 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
}
this.layout.attr("items", items);
this.layout.resize();
this.scrollContainer.element.scrollTop(o.scrollTop);
try {
this.scrollContainer.element.scrollTop(o.scrollTop);
} catch (e) {
}
},
_getHeaderHeight: function () {
@ -352,7 +356,11 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
setVerticalScroll: function (scrollTop) {
if (this.options.scrollTop !== scrollTop) {
this.options.scrollTop = scrollTop;
this.scrollContainer.element.scrollTop(scrollTop);
try {
this.scrollContainer.element.scrollTop(scrollTop);
} catch (e) {
}
}
},
@ -15816,7 +15824,11 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.layout.attr("items", items);
this.layout.resize();
this.container.setHeight(o.items.length * o.rowSize);
this.scrollContainer.element.scrollTop(o.scrollTop);
try {
this.scrollContainer.element.scrollTop(o.scrollTop);
} catch (e) {
}
},
_createHeader: function () {
@ -15925,7 +15937,11 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
setVerticalScroll: function (scrollTop) {
if (this.options.scrollTop !== scrollTop) {
this.options.scrollTop = scrollTop;
this.scrollContainer.element.scrollTop(scrollTop);
try {
this.scrollContainer.element.scrollTop(scrollTop);
} catch (e) {
}
}
},

4
docs/base.css

@ -1196,13 +1196,13 @@ li.CodeMirror-hint-active {
}
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
.public-scrollbar-face-active:after {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark .public-scrollbar-main:hover .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-main-active .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-faceActive:after {
.bi-theme-dark .public-scrollbar-face-active:after {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}

160
docs/base.js

@ -28225,6 +28225,160 @@ BI.Svg = BI.inherit(BI.Widget, {
}
});
BI.shortcut("bi.svg", BI.Svg);/**
*
* 原生表格滚动条为了IE8的兼容
*
* Created by GUY on 2016/1/12.
* @class BI.NativeTableScrollbar
* @extends BI.Widget
*/
BI.NativeTableScrollbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NativeTableScrollbar.superclass._defaultConfig.apply(this, arguments), {
attributes: {
tabIndex: 0
},
contentSize: 0,
defaultPosition: 0,
position: 0,
size: 0
})
},
render: function () {
var self = this, o = this.options;
//把滚动台size改掉
BI.GridTableScrollbar.SIZE = 16;
var throttle = BI.throttle(function () {
self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollTop());
}, 150, {leading: false});
this.element.scroll(function () {
throttle();
});
return {
type: "bi.default",
scrolly: true,
items: [{
type: "bi.layout",
width: 1,
ref: function (_ref) {
self.inner = _ref;
}
}]
}
},
mounted: function () {
this._populate();
},
_populate: function () {
var self = this, o = this.options;
if (o.size < 1 || o.contentSize <= o.size) {
this.setVisible(false);
return;
}
this.setVisible(true);
try {
this.element.scrollTop(o.position);
} catch (e) {
}
this.inner.element.height(o.contentSize);
},
setContentSize: function (contentSize) {
this.options.contentSize = contentSize;
},
setPosition: function (position) {
this.options.position = position;
},
setSize: function (size) {
this.setHeight(size);
this.options.size = size;
},
populate: function () {
this._populate();
}
});
BI.NativeTableScrollbar.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.native_table_scrollbar", BI.NativeTableScrollbar);
BI.NativeTableHorizontalScrollbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NativeTableHorizontalScrollbar.superclass._defaultConfig.apply(this, arguments), {
attributes: {
tabIndex: 0
},
contentSize: 0,
position: 0,
size: 0
})
},
render: function () {
var self = this, o = this.options;
//把滚动台size改掉
BI.GridTableScrollbar.SIZE = 16;
var throttle = BI.throttle(function () {
self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollLeft());
}, 150, {leading: false});
this.element.scroll(function () {
throttle();
});
return {
type: "bi.default",
scrollx: true,
items: [{
type: "bi.layout",
height: 1,
ref: function (_ref) {
self.inner = _ref;
}
}]
}
},
setContentSize: function (contentSize) {
this.options.contentSize = contentSize;
},
setPosition: function (position) {
this.options.position = position;
},
setSize: function (size) {
this.setWidth(size);
this.options.size = size;
},
_populate: function () {
var self = this, o = this.options;
if (o.size < 1 || o.contentSize <= o.size) {
this.setVisible(false);
return;
}
this.setVisible(true);
try {
this.element.scrollLeft(o.position);
} catch (e) {
}
this.inner.element.width(o.contentSize);
},
populate: function () {
this._populate();
}
});
BI.NativeTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.native_table_horizontal_scrollbar", BI.NativeTableHorizontalScrollbar);/**
*
* 表格
*
@ -29821,7 +29975,11 @@ BI.GridTableScrollbar = BI.inherit(BI.Widget, {
} else {
this._mouseMoveTracker.captureMouseMoves(e);
}
this.element[0].focus();
try {
this.element[0].focus();
} catch (e) {
}
},
_onMouseMove: function (deltaX, deltaY) {

35
docs/core.js

@ -14062,6 +14062,26 @@ if (!window.BI) {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
},
isIE9Below: function () {
if (!BI.isIE()) {
return false;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
if (v1 && v2 && v1[1] && v2[1]) {
version = Math.max(v1[1] * 1, v2[1] * 1);
} else if (v1 && v1[1]) {
version = v1[1] * 1;
} else if (v2 && v2[1]) {
version = v2[1] * 1;
} else {
version = 0;
}
return version < 9;
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},
@ -28953,6 +28973,21 @@ $(function () {
return ob;
}
});
//注册滚动条
BI.Plugin.registerWidget("bi.grid_table_scrollbar", function (ob) {
if (BI.isIE9Below()) {
return BI.extend(ob, {type: "bi.native_table_scrollbar"});
} else {
return ob;
}
});
BI.Plugin.registerWidget("bi.grid_table_horizontal_scrollbar", function (ob) {
if (BI.isIE9Below()) {
return BI.extend(ob, {type: "bi.native_table_horizontal_scrollbar"});
} else {
return ob;
}
});
//注册控件
BI.Plugin.registerWidget("bi.grid_table", function (ob) {

26
docs/resource.css

@ -3,7 +3,7 @@
/**** custom color(自定义颜色,用于特定场景) ****/
@font-face {
font-family: 'bi';
src: url('font/iconfont.eot?#iefix') format('embedded-opentype'), /* 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');
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');
/* iOS 4.1- */
}
@ -51,20 +51,11 @@ body {
-moz-outline: 0 none;
outline: 0 none;
}
#wrapper {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
}
div::-webkit-scrollbar,
textarea::-webkit-scrollbar {
-webkit-appearance: none;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
width: 6px;
height: 6px;
}
@ -74,11 +65,18 @@ textarea::-webkit-scrollbar-thumb {
-moz-border-radius: 0;
border-radius: 0;
background-color: rgba(102, 102, 102, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d666666,endColorstr=#4d666666);
}
div::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark div::-webkit-scrollbar,
.bi-theme-dark textarea::-webkit-scrollbar {
-webkit-appearance: none;
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
width: 6px;
height: 6px;
}
@ -88,6 +86,12 @@ textarea::-webkit-scrollbar-thumb {
-moz-border-radius: 0;
border-radius: 0;
background-color: rgba(204, 204, 204, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4dcccccc,endColorstr=#4dcccccc);
}
.bi-theme-dark div::-webkit-scrollbar-thumb:hover,
.bi-theme-dark textarea::-webkit-scrollbar-thumb:hover {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}
.base-line-conn-background {
background: url('icon/tree-vertical-line-1.png') repeat-y 0 0;

24
docs/widget.js

@ -178,7 +178,11 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
}
this.layout.attr("items", items);
this.layout.resize();
this.scrollContainer.element.scrollTop(o.scrollTop);
try {
this.scrollContainer.element.scrollTop(o.scrollTop);
} catch (e) {
}
},
_getHeaderHeight: function () {
@ -352,7 +356,11 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
setVerticalScroll: function (scrollTop) {
if (this.options.scrollTop !== scrollTop) {
this.options.scrollTop = scrollTop;
this.scrollContainer.element.scrollTop(scrollTop);
try {
this.scrollContainer.element.scrollTop(scrollTop);
} catch (e) {
}
}
},
@ -15816,7 +15824,11 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.layout.attr("items", items);
this.layout.resize();
this.container.setHeight(o.items.length * o.rowSize);
this.scrollContainer.element.scrollTop(o.scrollTop);
try {
this.scrollContainer.element.scrollTop(o.scrollTop);
} catch (e) {
}
},
_createHeader: function () {
@ -15925,7 +15937,11 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
setVerticalScroll: function (scrollTop) {
if (this.options.scrollTop !== scrollTop) {
this.options.scrollTop = scrollTop;
this.scrollContainer.element.scrollTop(scrollTop);
try {
this.scrollContainer.element.scrollTop(scrollTop);
} catch (e) {
}
}
},

155
src/base/table/native.scrollbar.js

@ -0,0 +1,155 @@
/**
*
* 原生表格滚动条为了IE8的兼容
*
* Created by GUY on 2016/1/12.
* @class BI.NativeTableScrollbar
* @extends BI.Widget
*/
BI.NativeTableScrollbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NativeTableScrollbar.superclass._defaultConfig.apply(this, arguments), {
attributes: {
tabIndex: 0
},
contentSize: 0,
defaultPosition: 0,
position: 0,
size: 0
})
},
render: function () {
var self = this, o = this.options;
//把滚动台size改掉
BI.GridTableScrollbar.SIZE = 16;
var throttle = BI.throttle(function () {
self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollTop());
}, 150, {leading: false});
this.element.scroll(function () {
throttle();
});
return {
type: "bi.default",
scrolly: true,
items: [{
type: "bi.layout",
width: 1,
ref: function (_ref) {
self.inner = _ref;
}
}]
}
},
mounted: function () {
this._populate();
},
_populate: function () {
var self = this, o = this.options;
if (o.size < 1 || o.contentSize <= o.size) {
this.setVisible(false);
return;
}
this.setVisible(true);
try {
this.element.scrollTop(o.position);
} catch (e) {
}
this.inner.element.height(o.contentSize);
},
setContentSize: function (contentSize) {
this.options.contentSize = contentSize;
},
setPosition: function (position) {
this.options.position = position;
},
setSize: function (size) {
this.setHeight(size);
this.options.size = size;
},
populate: function () {
this._populate();
}
});
BI.NativeTableScrollbar.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.native_table_scrollbar", BI.NativeTableScrollbar);
BI.NativeTableHorizontalScrollbar = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.NativeTableHorizontalScrollbar.superclass._defaultConfig.apply(this, arguments), {
attributes: {
tabIndex: 0
},
contentSize: 0,
position: 0,
size: 0
})
},
render: function () {
var self = this, o = this.options;
//把滚动台size改掉
BI.GridTableScrollbar.SIZE = 16;
var throttle = BI.throttle(function () {
self.fireEvent(BI.NativeTableScrollbar.EVENT_SCROLL, self.element.scrollLeft());
}, 150, {leading: false});
this.element.scroll(function () {
throttle();
});
return {
type: "bi.default",
scrollx: true,
items: [{
type: "bi.layout",
height: 1,
ref: function (_ref) {
self.inner = _ref;
}
}]
}
},
setContentSize: function (contentSize) {
this.options.contentSize = contentSize;
},
setPosition: function (position) {
this.options.position = position;
},
setSize: function (size) {
this.setWidth(size);
this.options.size = size;
},
_populate: function () {
var self = this, o = this.options;
if (o.size < 1 || o.contentSize <= o.size) {
this.setVisible(false);
return;
}
this.setVisible(true);
try {
this.element.scrollLeft(o.position);
} catch (e) {
}
this.inner.element.width(o.contentSize);
},
populate: function () {
this._populate();
}
});
BI.NativeTableHorizontalScrollbar.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.native_table_horizontal_scrollbar", BI.NativeTableHorizontalScrollbar);

6
src/base/table/table.grid.scrollbar.js

@ -154,7 +154,11 @@ BI.GridTableScrollbar = BI.inherit(BI.Widget, {
} else {
this._mouseMoveTracker.captureMouseMoves(e);
}
this.element[0].focus();
try {
this.element[0].focus();
} catch (e) {
}
},
_onMouseMove: function (deltaX, deltaY) {

15
src/config.js

@ -54,6 +54,21 @@ $(function () {
return ob;
}
});
//注册滚动条
BI.Plugin.registerWidget("bi.grid_table_scrollbar", function (ob) {
if (BI.isIE9Below()) {
return BI.extend(ob, {type: "bi.native_table_scrollbar"});
} else {
return ob;
}
});
BI.Plugin.registerWidget("bi.grid_table_horizontal_scrollbar", function (ob) {
if (BI.isIE9Below()) {
return BI.extend(ob, {type: "bi.native_table_horizontal_scrollbar"});
} else {
return ob;
}
});
//注册控件
BI.Plugin.registerWidget("bi.grid_table", function (ob) {

20
src/core/base.js

@ -1025,6 +1025,26 @@ if (!window.BI) {
return /(msie|trident)/i.test(navigator.userAgent.toLowerCase());
},
isIE9Below: function () {
if (!BI.isIE()) {
return false;
}
var version = 0;
var agent = navigator.userAgent.toLowerCase();
var v1 = agent.match(/(?:msie\s([\w.]+))/);
var v2 = agent.match(/(?:trident.*rv:([\w.]+))/);
if (v1 && v2 && v1[1] && v2[1]) {
version = Math.max(v1[1] * 1, v2[1] * 1);
} else if (v1 && v1[1]) {
version = v1[1] * 1;
} else if (v2 && v2[1]) {
version = v2[1] * 1;
} else {
version = 0;
}
return version < 9;
},
isEdge: function () {
return /edge/i.test(navigator.userAgent.toLowerCase());
},

4
src/css/base/table/table.grid.scrollbar.css

@ -100,13 +100,13 @@
}
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
.public-scrollbar-face-active:after {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark .public-scrollbar-main:hover .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-main-active .public-scrollbar-face:after,
.bi-theme-dark .public-scrollbar-faceActive:after {
.bi-theme-dark .public-scrollbar-face-active:after {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}

26
src/css/resource/app.css

@ -3,7 +3,7 @@
/**** custom color(自定义颜色,用于特定场景) ****/
@font-face {
font-family: 'bi';
src: url('font/iconfont.eot?#iefix') format('embedded-opentype'), /* 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');
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');
/* iOS 4.1- */
}
@ -51,20 +51,11 @@ body {
-moz-outline: 0 none;
outline: 0 none;
}
#wrapper {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
}
div::-webkit-scrollbar,
textarea::-webkit-scrollbar {
-webkit-appearance: none;
background-color: rgba(102, 102, 102, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d666666,endColorstr=#0d666666);
width: 6px;
height: 6px;
}
@ -74,11 +65,18 @@ textarea::-webkit-scrollbar-thumb {
-moz-border-radius: 0;
border-radius: 0;
background-color: rgba(102, 102, 102, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d666666,endColorstr=#4d666666);
}
div::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
background-color: rgba(102, 102, 102, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3666666,endColorstr=#b3666666);
}
.bi-theme-dark div::-webkit-scrollbar,
.bi-theme-dark textarea::-webkit-scrollbar {
-webkit-appearance: none;
background-color: rgba(204, 204, 204, 0.05);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dcccccc,endColorstr=#0dcccccc);
width: 6px;
height: 6px;
}
@ -88,4 +86,10 @@ textarea::-webkit-scrollbar-thumb {
-moz-border-radius: 0;
border-radius: 0;
background-color: rgba(204, 204, 204, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4dcccccc,endColorstr=#4dcccccc);
}
.bi-theme-dark div::-webkit-scrollbar-thumb:hover,
.bi-theme-dark textarea::-webkit-scrollbar-thumb:hover {
background-color: rgba(204, 204, 204, 0.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#b3cccccc,endColorstr=#b3cccccc);
}

4
src/less/base/table/table.grid.scrollbar.less

@ -126,14 +126,14 @@
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
.public-scrollbar-face-active:after {
.background-color(@scroll-color, 70%);
}
.bi-theme-dark {
.public-scrollbar-main:hover .public-scrollbar-face:after,
.public-scrollbar-main-active .public-scrollbar-face:after,
.public-scrollbar-faceActive:after {
.public-scrollbar-face-active:after {
.background-color(@scroll-color-theme-dark, 70%);
}
}

51
src/less/lib/colors.less

@ -107,56 +107,5 @@
//失败边框
@color-bi-tooltip-warning-border: @border-color-error;
//dimension
@color-dimension-background: @background-color-light-blue;
@color-target-background: @background-color-light-green;
@color-dimension-region-border: @border-color-light-blue;
@color-target-region-border: @border-color-light-green;
@color-dimension-background-theme-dark: @background-color-light-blue-theme-dark;
@color-target-background-theme-dark: @background-color-light-green-theme-dark;
@color-dimension-region-border-theme-dark: @border-color-light-blue-theme-dark;
@color-target-region-border-theme-dark: @border-color-light-green-theme-dark;
//etl operator
@color-etl-operator: @background-color-light-blue;
//data source table, etl table, excel table, sql table
@color-table-active-background: @background-color-light-blue;
//join union 表格的间隔色
@color-table-result-background: @table-color-blue;
@color-table-background1: @table-color-yellow;
@color-table-background2: @table-color-green;
@color-table-background3: @table-color-light-blue;
@color-table-background4: @table-color-purple;
@color-table-background5: @table-color-pink;
//我创建的
@color-create-file-text: @font-color-orange;
@color-target-style-condition-background: @background-color-light-blue;
@color-target-style-condition-border: @border-color-light-blue;
@color-target-style-less: @background-color-negative;
@color-target-style-equal: @background-color-yellow;
@color-target-style-more: @background-color-dark-success;
@color-login-info-fields-group-background: @background-color-light-blue;
//mask颜色
@color-bi-button-mask: @color-bi-background-black;
// 数据连接底色 10种 --start--
@color-bi-data-link-button-color1: @data-link-color1;
@color-bi-data-link-button-color2: @data-link-color2;
@color-bi-data-link-button-color3: @data-link-color3;
@color-bi-data-link-button-color4: @data-link-color4;
@color-bi-data-link-button-color5: @data-link-color5;
@color-bi-data-link-button-color6: @data-link-color6;
@color-bi-data-link-button-color7: @data-link-color7;
@color-bi-data-link-button-color8: @data-link-color8;
@color-bi-data-link-button-color9: @data-link-color9;
@color-bi-data-link-button-color10: @data-link-color10;
// 数据连接底色 10种 --end--
@color-bi-progress-text-bar-background: @border-color-light-green;
@color-bi-progress-text-bar-processor: @border-color-success;

29
src/less/lib/constant.less

@ -41,11 +41,6 @@
@background-color-dark: #d4dadd;
@background-color-disabled: #cccccc;
@background-color-light-blue: #d8f2fd;//
@background-color-light-green: #e1f4e7;//
@background-color-light-blue-theme-dark: #008ae9;//
@background-color-light-green-theme-dark: #04b1c2;//
@background-color-orange: #fef6de;
@background-color-green: #eefbff;
@background-color-yellow: #f9a744;
@ -73,11 +68,6 @@
@border-color-error: #f4cbcb;
@border-color-normal-success: #eddea2;
@border-color-light-blue: #d8f2fd;//
@border-color-light-green: #e1f4e7;//
@border-color-light-blue-theme-dark: #008ae9;//
@border-color-light-green-theme-dark: #04b1c2;//
@border-color-dark: #c4c6c6;
//scroll color
@ -94,22 +84,3 @@
//shadow color
@shadow-color-black: #000000;
//表格的间隔色
@table-color-blue: #d9f2fc;
@table-color-yellow: #fef6df;
@table-color-green: #daf3dc;
@table-color-light-blue: #d6f7f0;
@table-color-purple: #e8e6fe;
@table-color-pink: #fee9e9;
@data-link-color1: #009de3;
@data-link-color2: #4fc1e9;
@data-link-color3: #48cfad;
@data-link-color4: #57cb7c;
@data-link-color5: #a0d468;
@data-link-color6: #fbaf4f;
@data-link-color7: #fc6e51;
@data-link-color8: #ed5565;
@data-link-color9: #ac92ec;
@data-link-color10: #5d9cec;

27
src/less/resource/app.less

@ -2,7 +2,7 @@
@font-face {
font-family: 'bi';
src: url('@{webUrl}font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('@{webUrl}font/iconfont.woff') format('woff'), /* chrome、firefox */ url('@{webUrl}font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{webUrl}font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */
src: url('@{webUrl}font/iconfont.eot'), /* IE6-IE8 */ url('@{webUrl}font/iconfont.woff') format('woff'), /* chrome、firefox */ url('@{webUrl}font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{webUrl}font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */
}
.b-font {
@ -47,27 +47,19 @@ body {
outline: 0 none;
}
#wrapper {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
overflow: hidden;
overflow-x: hidden;
overflow-y: hidden;
}
div, textarea {
&::-webkit-scrollbar {
-webkit-appearance: none;
background-color: @scroll-color;
.background-color(@scroll-color, 5%);
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-thumb {
.border-radius(0);
background-color: @scroll-thumb-color;
.background-color(@scroll-color, 30%);
&:hover {
.background-color(@scroll-color, 70%);
}
}
}
@ -75,13 +67,16 @@ div, textarea {
div, textarea {
&::-webkit-scrollbar {
-webkit-appearance: none;
background-color: @scroll-color-theme-dark;
.background-color(@scroll-color-theme-dark, 5%);
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-thumb {
.border-radius(0);
background-color: @scroll-thumb-color-theme-dark;
.background-color(@scroll-color-theme-dark, 30%);
&:hover {
.background-color(@scroll-color-theme-dark, 70%);
}
}
}
}

12
src/widget/sequencetable/listnumber.sequencetable.js

@ -80,7 +80,11 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
this.layout.attr("items", items);
this.layout.resize();
this.container.setHeight(o.items.length * o.rowSize);
this.scrollContainer.element.scrollTop(o.scrollTop);
try {
this.scrollContainer.element.scrollTop(o.scrollTop);
} catch (e) {
}
},
_createHeader: function () {
@ -189,7 +193,11 @@ BI.SequenceTableListNumber = BI.inherit(BI.Widget, {
setVerticalScroll: function (scrollTop) {
if (this.options.scrollTop !== scrollTop) {
this.options.scrollTop = scrollTop;
this.scrollContainer.element.scrollTop(scrollTop);
try {
this.scrollContainer.element.scrollTop(scrollTop);
} catch (e) {
}
}
},

12
src/widget/sequencetable/treenumber.sequencetable.js

@ -178,7 +178,11 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
}
this.layout.attr("items", items);
this.layout.resize();
this.scrollContainer.element.scrollTop(o.scrollTop);
try {
this.scrollContainer.element.scrollTop(o.scrollTop);
} catch (e) {
}
},
_getHeaderHeight: function () {
@ -352,7 +356,11 @@ BI.SequenceTableTreeNumber = BI.inherit(BI.Widget, {
setVerticalScroll: function (scrollTop) {
if (this.options.scrollTop !== scrollTop) {
this.options.scrollTop = scrollTop;
this.scrollContainer.element.scrollTop(scrollTop);
try {
this.scrollContainer.element.scrollTop(scrollTop);
} catch (e) {
}
}
},

Loading…
Cancel
Save