From 7749ecea49f61656f8cbe7df8b0743f5158c2a4a Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 16 Apr 2017 21:45:52 +0800 Subject: [PATCH] add --- bi/base.js | 10 ++---- bi/core.js | 34 ++++++++++--------- bi/widget.css | 23 ++----------- docs/base.js | 10 ++---- docs/core.js | 34 ++++++++++--------- docs/widget.css | 23 ++----------- src/base/layer/layer.popup.js | 7 +--- src/base/table/table.js | 3 +- src/core/func/function.js | 2 +- src/core/widget.js | 17 ++-------- src/core/wrapper/layout.js | 15 ++++++++ src/css/lib/style.css | 2 -- .../trigger/button.checkselected.css | 4 --- .../multitree/check/multi.tree.check.pane.css | 6 ++-- .../widget/multitree/display.multi.tree.css | 3 -- .../widget/multitree/trigger.multi.tree.css | 9 ----- .../multi.tree.button.checkselected.css | 1 - src/less/bibase.less | 3 +- src/less/lib/style.less | 3 -- .../trigger/button.checkselected.less | 7 ---- .../check/multi.tree.check.pane.less | 14 +++++--- .../widget/multitree/display.multi.tree.less | 1 - .../widget/multitree/trigger.multi.tree.less | 11 ++---- .../multi.tree.button.checkselected.less | 1 - 24 files changed, 84 insertions(+), 159 deletions(-) delete mode 100644 src/css/lib/style.css delete mode 100644 src/less/lib/style.less diff --git a/bi/base.js b/bi/base.js index 3eb95a6784..8e7faa0976 100644 --- a/bi/base.js +++ b/bi/base.js @@ -15044,12 +15044,7 @@ BI.PopupView = BI.inherit(BI.Widget, { "max-width": o.maxWidth + "px" }).bind({"click": fn}); - //FIXME IE8下 jquery.mousewheeel.js 第一次执行65行$elem["offsetParent"]()的时候报错:未指明的错误 但是第二次或者调试的时候展开一下$elem内容均能避免上述问题 - try { - this.element.bind("mousewheel", fn); - } catch (e) { - this.element.bind("mousewheel", fn); - } + this.element.bind("mousewheel", fn); o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn}); o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop}); @@ -30824,13 +30819,14 @@ BI.Table = BI.inherit(BI.Widget, { .addClass(c === rows.length - 1 ? "last-col" : ""); var w = BI.createWidget(map[r][c], { type: "bi.table_cell", - root: true, textAlign: "left", width: BI.isNumeric(width) ? width : "", height: BI.isNumeric(height) ? height : "", _row: r, _col: c + start }); + self.addWidget(w.getName(), w); + w._mount(); w.element.css("position", "relative"); td.append(w.element); tr.append(td); diff --git a/bi/core.js b/bi/core.js index fdac19401c..f6e3aa9f67 100644 --- a/bi/core.js +++ b/bi/core.js @@ -4426,27 +4426,14 @@ BI.Widget = BI.inherit(BI.OB, { } this.beforeMounted && this.beforeMounted(); this._isMounted = true; - this._mountChildren(); + this._mountChildren && this._mountChildren(); BI.each(this._children, function (i, widget) { widget._mount && widget._mount(); }); this.mounted && this.mounted(); }, - _mountChildren: function () { - var self = this; - var frag = document.createDocumentFragment(); - var hasChild = false; - BI.each(this._children, function (i, widget) { - if (widget.element !== self.element) { - frag.appendChild(widget.element[0]); - hasChild = true; - } - }); - if (hasChild === true) { - this.element.append(frag); - } - }, + _mountChildren: null, _unMount: function () { BI.each(this._children, function (i, widget) { @@ -11110,6 +11097,21 @@ BI.Layout = BI.inherit(BI.Widget, { } }, + _mountChildren: function () { + var self = this; + var frag = document.createDocumentFragment(); + var hasChild = false; + BI.each(this._children, function (i, widget) { + if (widget.element !== self.element) { + frag.appendChild(widget.element[0]); + hasChild = true; + } + }); + if (hasChild === true) { + this.element.append(frag); + } + }, + _getChildName: function (index) { return index + ""; }, @@ -17034,7 +17036,7 @@ $(function () { } var rgb = this.rgb2json(this.hex2rgb(hex)); var grayLevel = Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114); - if (grayLevel < 192) { + if (grayLevel < 140) { return true; } return false; diff --git a/bi/widget.css b/bi/widget.css index 30c4bdc6c1..3b3cbee3e4 100644 --- a/bi/widget.css +++ b/bi/widget.css @@ -333,12 +333,8 @@ -moz-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; color: #009de3; - background-color: #ffffff; z-index: 1; } -.bi-theme-dark .bi-multi-select-check-selected-button { - background-color: #191a2c; -} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ @@ -353,18 +349,15 @@ .bi-multi-tree-check-pane { background-color: #f4f4f4; } -.bi-multi-tree-check-pane .multi-tree-continue-select { - background-color: #f4f4f4; -} .bi-multi-tree-check-pane .multi-tree-check-selected { color: #009de3; } +.bi-theme-dark .bi-multi-tree-check-pane { + background-color: #191a2c; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-multi-tree-display { - background-color: #f4f4f4; -} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ @@ -415,15 +408,6 @@ -moz-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; } -.bi-multi-tree-trigger .trigger-check-selected { - border: 1px solid #009de3; - -webkit-border-radius: 8px 8px 8px 8px; - -moz-border-radius: 8px 8px 8px 8px; - border-radius: 8px 8px 8px 8px; - color: #009de3; - background-color: #ffffff; - z-index: 1; -} .bi-multi-tree-trigger .trigger-icon-button { border-left: 1px solid #d4dadd; font-size: 16px; @@ -437,7 +421,6 @@ -moz-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; color: #009de3; - background-color: #ffffff; z-index: 1; } /****添加计算宽度的--运算符直接需要space****/ diff --git a/docs/base.js b/docs/base.js index 3eb95a6784..8e7faa0976 100644 --- a/docs/base.js +++ b/docs/base.js @@ -15044,12 +15044,7 @@ BI.PopupView = BI.inherit(BI.Widget, { "max-width": o.maxWidth + "px" }).bind({"click": fn}); - //FIXME IE8下 jquery.mousewheeel.js 第一次执行65行$elem["offsetParent"]()的时候报错:未指明的错误 但是第二次或者调试的时候展开一下$elem内容均能避免上述问题 - try { - this.element.bind("mousewheel", fn); - } catch (e) { - this.element.bind("mousewheel", fn); - } + this.element.bind("mousewheel", fn); o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn}); o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop}); @@ -30824,13 +30819,14 @@ BI.Table = BI.inherit(BI.Widget, { .addClass(c === rows.length - 1 ? "last-col" : ""); var w = BI.createWidget(map[r][c], { type: "bi.table_cell", - root: true, textAlign: "left", width: BI.isNumeric(width) ? width : "", height: BI.isNumeric(height) ? height : "", _row: r, _col: c + start }); + self.addWidget(w.getName(), w); + w._mount(); w.element.css("position", "relative"); td.append(w.element); tr.append(td); diff --git a/docs/core.js b/docs/core.js index 58742196e3..9dab9b4df6 100644 --- a/docs/core.js +++ b/docs/core.js @@ -14421,27 +14421,14 @@ BI.Widget = BI.inherit(BI.OB, { } this.beforeMounted && this.beforeMounted(); this._isMounted = true; - this._mountChildren(); + this._mountChildren && this._mountChildren(); BI.each(this._children, function (i, widget) { widget._mount && widget._mount(); }); this.mounted && this.mounted(); }, - _mountChildren: function () { - var self = this; - var frag = document.createDocumentFragment(); - var hasChild = false; - BI.each(this._children, function (i, widget) { - if (widget.element !== self.element) { - frag.appendChild(widget.element[0]); - hasChild = true; - } - }); - if (hasChild === true) { - this.element.append(frag); - } - }, + _mountChildren: null, _unMount: function () { BI.each(this._children, function (i, widget) { @@ -19326,6 +19313,21 @@ BI.Layout = BI.inherit(BI.Widget, { } }, + _mountChildren: function () { + var self = this; + var frag = document.createDocumentFragment(); + var hasChild = false; + BI.each(this._children, function (i, widget) { + if (widget.element !== self.element) { + frag.appendChild(widget.element[0]); + hasChild = true; + } + }); + if (hasChild === true) { + this.element.append(frag); + } + }, + _getChildName: function (index) { return index + ""; }, @@ -22658,7 +22660,7 @@ $(function () { } var rgb = this.rgb2json(this.hex2rgb(hex)); var grayLevel = Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114); - if (grayLevel < 192) { + if (grayLevel < 140) { return true; } return false; diff --git a/docs/widget.css b/docs/widget.css index 30c4bdc6c1..3b3cbee3e4 100644 --- a/docs/widget.css +++ b/docs/widget.css @@ -333,12 +333,8 @@ -moz-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; color: #009de3; - background-color: #ffffff; z-index: 1; } -.bi-theme-dark .bi-multi-select-check-selected-button { - background-color: #191a2c; -} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ @@ -353,18 +349,15 @@ .bi-multi-tree-check-pane { background-color: #f4f4f4; } -.bi-multi-tree-check-pane .multi-tree-continue-select { - background-color: #f4f4f4; -} .bi-multi-tree-check-pane .multi-tree-check-selected { color: #009de3; } +.bi-theme-dark .bi-multi-tree-check-pane { + background-color: #191a2c; +} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-multi-tree-display { - background-color: #f4f4f4; -} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ @@ -415,15 +408,6 @@ -moz-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; } -.bi-multi-tree-trigger .trigger-check-selected { - border: 1px solid #009de3; - -webkit-border-radius: 8px 8px 8px 8px; - -moz-border-radius: 8px 8px 8px 8px; - border-radius: 8px 8px 8px 8px; - color: #009de3; - background-color: #ffffff; - z-index: 1; -} .bi-multi-tree-trigger .trigger-icon-button { border-left: 1px solid #d4dadd; font-size: 16px; @@ -437,7 +421,6 @@ -moz-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; color: #009de3; - background-color: #ffffff; z-index: 1; } /****添加计算宽度的--运算符直接需要space****/ diff --git a/src/base/layer/layer.popup.js b/src/base/layer/layer.popup.js index 9589237e46..74f6618d14 100644 --- a/src/base/layer/layer.popup.js +++ b/src/base/layer/layer.popup.js @@ -55,12 +55,7 @@ BI.PopupView = BI.inherit(BI.Widget, { "max-width": o.maxWidth + "px" }).bind({"click": fn}); - //FIXME IE8下 jquery.mousewheeel.js 第一次执行65行$elem["offsetParent"]()的时候报错:未指明的错误 但是第二次或者调试的时候展开一下$elem内容均能避免上述问题 - try { - this.element.bind("mousewheel", fn); - } catch (e) { - this.element.bind("mousewheel", fn); - } + this.element.bind("mousewheel", fn); o.stopPropagation && this.element.bind({"mousedown": fn, "mouseup": fn, "mouseover": fn}); o.stopEvent && this.element.bind({"mousedown": stop, "mouseup": stop, "mouseover": stop}); diff --git a/src/base/table/table.js b/src/base/table/table.js index 8652d0543f..ed55301105 100644 --- a/src/base/table/table.js +++ b/src/base/table/table.js @@ -743,13 +743,14 @@ BI.Table = BI.inherit(BI.Widget, { .addClass(c === rows.length - 1 ? "last-col" : ""); var w = BI.createWidget(map[r][c], { type: "bi.table_cell", - root: true, textAlign: "left", width: BI.isNumeric(width) ? width : "", height: BI.isNumeric(height) ? height : "", _row: r, _col: c + start }); + self.addWidget(w.getName(), w); + w._mount(); w.element.css("position", "relative"); td.append(w.element); tr.append(td); diff --git a/src/core/func/function.js b/src/core/func/function.js index c8fdf37cdd..0732ef15aa 100644 --- a/src/core/func/function.js +++ b/src/core/func/function.js @@ -129,7 +129,7 @@ $(function () { } var rgb = this.rgb2json(this.hex2rgb(hex)); var grayLevel = Math.round(rgb.r * 0.299 + rgb.g * 0.587 + rgb.b * 0.114); - if (grayLevel < 192) { + if (grayLevel < 140) { return true; } return false; diff --git a/src/core/widget.js b/src/core/widget.js index fd56767dbd..2cd8c3b52f 100644 --- a/src/core/widget.js +++ b/src/core/widget.js @@ -161,27 +161,14 @@ BI.Widget = BI.inherit(BI.OB, { } this.beforeMounted && this.beforeMounted(); this._isMounted = true; - this._mountChildren(); + this._mountChildren && this._mountChildren(); BI.each(this._children, function (i, widget) { widget._mount && widget._mount(); }); this.mounted && this.mounted(); }, - _mountChildren: function () { - var self = this; - var frag = document.createDocumentFragment(); - var hasChild = false; - BI.each(this._children, function (i, widget) { - if (widget.element !== self.element) { - frag.appendChild(widget.element[0]); - hasChild = true; - } - }); - if (hasChild === true) { - this.element.append(frag); - } - }, + _mountChildren: null, _unMount: function () { BI.each(this._children, function (i, widget) { diff --git a/src/core/wrapper/layout.js b/src/core/wrapper/layout.js index cf23c39745..abca6b0055 100644 --- a/src/core/wrapper/layout.js +++ b/src/core/wrapper/layout.js @@ -63,6 +63,21 @@ BI.Layout = BI.inherit(BI.Widget, { } }, + _mountChildren: function () { + var self = this; + var frag = document.createDocumentFragment(); + var hasChild = false; + BI.each(this._children, function (i, widget) { + if (widget.element !== self.element) { + frag.appendChild(widget.element[0]); + hasChild = true; + } + }); + if (hasChild === true) { + this.element.append(frag); + } + }, + _getChildName: function (index) { return index + ""; }, diff --git a/src/css/lib/style.css b/src/css/lib/style.css deleted file mode 100644 index 6dfa999cc7..0000000000 --- a/src/css/lib/style.css +++ /dev/null @@ -1,2 +0,0 @@ -/****** common color(常用颜色,可用于普遍场景) *****/ -/**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/src/css/widget/multiselect/trigger/button.checkselected.css b/src/css/widget/multiselect/trigger/button.checkselected.css index 1ebfc22ab3..d33c08284b 100644 --- a/src/css/widget/multiselect/trigger/button.checkselected.css +++ b/src/css/widget/multiselect/trigger/button.checkselected.css @@ -7,9 +7,5 @@ -moz-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; color: #009de3; - background-color: #ffffff; z-index: 1; } -.bi-theme-dark .bi-multi-select-check-selected-button { - background-color: #191a2c; -} diff --git a/src/css/widget/multitree/check/multi.tree.check.pane.css b/src/css/widget/multitree/check/multi.tree.check.pane.css index e47d209b74..520e20e70c 100644 --- a/src/css/widget/multitree/check/multi.tree.check.pane.css +++ b/src/css/widget/multitree/check/multi.tree.check.pane.css @@ -4,9 +4,9 @@ .bi-multi-tree-check-pane { background-color: #f4f4f4; } -.bi-multi-tree-check-pane .multi-tree-continue-select { - background-color: #f4f4f4; -} .bi-multi-tree-check-pane .multi-tree-check-selected { color: #009de3; } +.bi-theme-dark .bi-multi-tree-check-pane { + background-color: #191a2c; +} diff --git a/src/css/widget/multitree/display.multi.tree.css b/src/css/widget/multitree/display.multi.tree.css index 95ed7ce025..2f6491e13f 100644 --- a/src/css/widget/multitree/display.multi.tree.css +++ b/src/css/widget/multitree/display.multi.tree.css @@ -1,6 +1,3 @@ /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ -.bi-multi-tree-display { - background-color: #f4f4f4; -} diff --git a/src/css/widget/multitree/trigger.multi.tree.css b/src/css/widget/multitree/trigger.multi.tree.css index a5d0d76f3f..0b4cae5589 100644 --- a/src/css/widget/multitree/trigger.multi.tree.css +++ b/src/css/widget/multitree/trigger.multi.tree.css @@ -7,15 +7,6 @@ -moz-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; } -.bi-multi-tree-trigger .trigger-check-selected { - border: 1px solid #009de3; - -webkit-border-radius: 8px 8px 8px 8px; - -moz-border-radius: 8px 8px 8px 8px; - border-radius: 8px 8px 8px 8px; - color: #009de3; - background-color: #ffffff; - z-index: 1; -} .bi-multi-tree-trigger .trigger-icon-button { border-left: 1px solid #d4dadd; font-size: 16px; diff --git a/src/css/widget/multitree/trigger/multi.tree.button.checkselected.css b/src/css/widget/multitree/trigger/multi.tree.button.checkselected.css index 33b983af34..b0122e9b72 100644 --- a/src/css/widget/multitree/trigger/multi.tree.button.checkselected.css +++ b/src/css/widget/multitree/trigger/multi.tree.button.checkselected.css @@ -7,6 +7,5 @@ -moz-border-radius: 8px 8px 8px 8px; border-radius: 8px 8px 8px 8px; color: #009de3; - background-color: #ffffff; z-index: 1; } diff --git a/src/less/bibase.less b/src/less/bibase.less index 6fa57065f7..5f0b88dc25 100644 --- a/src/less/bibase.less +++ b/src/less/bibase.less @@ -3,5 +3,4 @@ @import "typographic"; @import "visual"; @import "var"; -@import "lib/colors"; -@import "lib/style"; \ No newline at end of file +@import "lib/colors"; \ No newline at end of file diff --git a/src/less/lib/style.less b/src/less/lib/style.less deleted file mode 100644 index 78fc5d37ac..0000000000 --- a/src/less/lib/style.less +++ /dev/null @@ -1,3 +0,0 @@ -@import "colors"; - -//公共样式类库 diff --git a/src/less/widget/multiselect/trigger/button.checkselected.less b/src/less/widget/multiselect/trigger/button.checkselected.less index 2e4cbd59e6..365ed73f64 100644 --- a/src/less/widget/multiselect/trigger/button.checkselected.less +++ b/src/less/widget/multiselect/trigger/button.checkselected.less @@ -4,12 +4,5 @@ border: 1px solid @color-bi-text-highlight; .border-corner-radius(8px, 8px, 8px, 8px); color: @color-bi-text-highlight; - background-color: @color-bi-background-default; z-index: 1; } - -.bi-theme-dark { - .bi-multi-select-check-selected-button { - background-color: @color-bi-background-normal-theme-dark; - } -} \ No newline at end of file diff --git a/src/less/widget/multitree/check/multi.tree.check.pane.less b/src/less/widget/multitree/check/multi.tree.check.pane.less index 93ac629738..a1c779a769 100644 --- a/src/less/widget/multitree/check/multi.tree.check.pane.less +++ b/src/less/widget/multitree/check/multi.tree.check.pane.less @@ -1,12 +1,16 @@ @import "../../../bibase"; - -.bi-multi-tree-check-pane{ +.bi-multi-tree-check-pane { background-color: @color-bi-background-gray; - & .multi-tree-continue-select{ - background-color: @color-bi-background-gray; + & .multi-tree-continue-select { } - & .multi-tree-check-selected{ + & .multi-tree-check-selected { color: @color-bi-text-highlight; } +} + +.bi-theme-dark { + .bi-multi-tree-check-pane { + background-color: @color-bi-background-normal-theme-dark; + } } \ No newline at end of file diff --git a/src/less/widget/multitree/display.multi.tree.less b/src/less/widget/multitree/display.multi.tree.less index 01dd64b229..0d31ac4dff 100644 --- a/src/less/widget/multitree/display.multi.tree.less +++ b/src/less/widget/multitree/display.multi.tree.less @@ -1,5 +1,4 @@ @import "../../bibase"; .bi-multi-tree-display{ - background-color: @color-bi-background-gray; } \ No newline at end of file diff --git a/src/less/widget/multitree/trigger.multi.tree.less b/src/less/widget/multitree/trigger.multi.tree.less index a132b0fc9a..be893f566a 100644 --- a/src/less/widget/multitree/trigger.multi.tree.less +++ b/src/less/widget/multitree/trigger.multi.tree.less @@ -1,17 +1,10 @@ @import "../../bibase"; -.bi-multi-tree-trigger{ +.bi-multi-tree-trigger { border: 1px solid @color-bi-border-normal; .border-corner-radius(2px, 2px, 2px, 2px); - & .trigger-check-selected{ - border: 1px solid @color-bi-text-highlight; - .border-corner-radius(8px, 8px, 8px, 8px); - color: @color-bi-text-highlight; - background-color: @color-bi-background-default; - z-index: 1; - } - & .trigger-icon-button{ + & .trigger-icon-button { border-left: 1px solid @color-bi-border-normal; font-size: 16px; } diff --git a/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less b/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less index 2049bc2c91..ef3bf4becf 100644 --- a/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less +++ b/src/less/widget/multitree/trigger/multi.tree.button.checkselected.less @@ -5,7 +5,6 @@ border: 1px solid @color-bi-text-highlight; .border-corner-radius(8px, 8px, 8px, 8px); color: @color-bi-text-highlight; - background-color: @color-bi-background-default; z-index: 1; } } \ No newline at end of file