From aca09b754c3e83bb5cfabc33f9e60fb9cb025fde Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 25 Apr 2017 10:31:05 +0800 Subject: [PATCH] add --- bi/base.js | 8 +++- bi/core.css | 49 ++++++++--------------- docs/base.js | 8 +++- docs/core.css | 49 ++++++++--------------- src/base/combination/group.combo.js | 2 +- src/base/single/button/button.basic.js | 6 ++- src/css/core/utils/common.css | 49 ++++++++--------------- src/less/core/utils/common.less | 55 ++++++++++---------------- 8 files changed, 89 insertions(+), 137 deletions(-) diff --git a/bi/base.js b/bi/base.js index 0077aef3b..f6241ad7e 100644 --- a/bi/base.js +++ b/bi/base.js @@ -713,6 +713,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -725,6 +726,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -870,7 +872,9 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; +BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; +BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP";/** * 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 * * Created by GUY on 2015/9/9. @@ -3453,7 +3457,7 @@ BI.shortcut("bi.expander", BI.Expander);/** BI.ComboGroup = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo-group", + baseCls: "bi-combo-group bi-list-item", //以下这些属性对每一个combo都是公用的 trigger: "click,hover", diff --git a/bi/core.css b/bi/core.css index 317fa4d81..5ae82a56d 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3162,38 +3162,6 @@ i { .bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { color: #666666 !important; } -.bi-list-item-hover:hover, -.bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #eff1f4; -} -.bi-list-item-hover.disabled, -.bi-list-item-hover.disabled:hover, -.bi-list-item-hover.disabled:active { - color: #cccccc !important; - background-color: transparent !important; -} -.bi-list-item-hover.disabled .bi-high-light, -.bi-list-item-hover.disabled:hover .bi-high-light, -.bi-list-item-hover.disabled:active .bi-high-light { - color: #cccccc !important; -} -.bi-theme-dark .bi-list-item-hover:hover, -.bi-theme-dark .bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #191b2b; -} -.bi-theme-dark .bi-list-item-hover.disabled, -.bi-theme-dark .bi-list-item-hover.disabled:hover, -.bi-theme-dark .bi-list-item-hover.disabled:active { - background-color: transparent !important; - color: #666666 !important; -} -.bi-theme-dark .bi-list-item-hover.disabled .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:hover .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:active .bi-high-light { - color: #666666 !important; -} .bi-list-item-active:hover, .bi-list-item-active.hover { color: #1a1a1a; @@ -3286,6 +3254,9 @@ i { .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-choose:hover { + color: #1a1a1a; +} .bi-list-item-choose:active, .bi-list-item-choose.active { color: #ffffff; @@ -3306,6 +3277,20 @@ i { .bi-list-item-choose.disabled:active .bi-high-light { color: #cccccc !important; } +.bi-theme-dark .bi-list-item-choose:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-choose.disabled, +.bi-theme-dark .bi-list-item-choose.disabled:hover, +.bi-theme-dark .bi-list-item-choose.disabled:active { + color: #666666 !important; + background-color: transparent !important; +} +.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light { + color: #666666 !important; +} /*****************cursor*****************/ .cursor-pointer { cursor: pointer; diff --git a/docs/base.js b/docs/base.js index 0077aef3b..f6241ad7e 100644 --- a/docs/base.js +++ b/docs/base.js @@ -713,6 +713,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -725,6 +726,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -870,7 +872,9 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE";/** +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; +BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; +BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP";/** * 表示一个可以展开的节点, 不仅有选中状态而且有展开状态 * * Created by GUY on 2015/9/9. @@ -3453,7 +3457,7 @@ BI.shortcut("bi.expander", BI.Expander);/** BI.ComboGroup = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo-group", + baseCls: "bi-combo-group bi-list-item", //以下这些属性对每一个combo都是公用的 trigger: "click,hover", diff --git a/docs/core.css b/docs/core.css index 317fa4d81..5ae82a56d 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3162,38 +3162,6 @@ i { .bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { color: #666666 !important; } -.bi-list-item-hover:hover, -.bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #eff1f4; -} -.bi-list-item-hover.disabled, -.bi-list-item-hover.disabled:hover, -.bi-list-item-hover.disabled:active { - color: #cccccc !important; - background-color: transparent !important; -} -.bi-list-item-hover.disabled .bi-high-light, -.bi-list-item-hover.disabled:hover .bi-high-light, -.bi-list-item-hover.disabled:active .bi-high-light { - color: #cccccc !important; -} -.bi-theme-dark .bi-list-item-hover:hover, -.bi-theme-dark .bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #191b2b; -} -.bi-theme-dark .bi-list-item-hover.disabled, -.bi-theme-dark .bi-list-item-hover.disabled:hover, -.bi-theme-dark .bi-list-item-hover.disabled:active { - background-color: transparent !important; - color: #666666 !important; -} -.bi-theme-dark .bi-list-item-hover.disabled .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:hover .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:active .bi-high-light { - color: #666666 !important; -} .bi-list-item-active:hover, .bi-list-item-active.hover { color: #1a1a1a; @@ -3286,6 +3254,9 @@ i { .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-choose:hover { + color: #1a1a1a; +} .bi-list-item-choose:active, .bi-list-item-choose.active { color: #ffffff; @@ -3306,6 +3277,20 @@ i { .bi-list-item-choose.disabled:active .bi-high-light { color: #cccccc !important; } +.bi-theme-dark .bi-list-item-choose:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-choose.disabled, +.bi-theme-dark .bi-list-item-choose.disabled:hover, +.bi-theme-dark .bi-list-item-choose.disabled:active { + color: #666666 !important; + background-color: transparent !important; +} +.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light { + color: #666666 !important; +} /*****************cursor*****************/ .cursor-pointer { cursor: pointer; diff --git a/src/base/combination/group.combo.js b/src/base/combination/group.combo.js index 89fce40c1..2d3314fd3 100644 --- a/src/base/combination/group.combo.js +++ b/src/base/combination/group.combo.js @@ -5,7 +5,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, { _defaultConfig: function () { return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this, arguments), { - baseCls: "bi-combo-group", + baseCls: "bi-combo-group bi-list-item", //以下这些属性对每一个combo都是公用的 trigger: "click,hover", diff --git a/src/base/single/button/button.basic.js b/src/base/single/button/button.basic.js index 41f23794c..ce8b283dd 100644 --- a/src/base/single/button/button.basic.js +++ b/src/base/single/button/button.basic.js @@ -130,6 +130,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = false; $(document).unbind("mouseup." + self.getName()); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_UP); // } }); if (mouseDown === true) { @@ -142,6 +143,7 @@ BI.BasicButton = BI.inherit(BI.Single, { } mouseDown = true; ev(e); + self.fireEvent(BI.BasicButton.EVENT_MOUSE_DOWN); // } }); hand.mouseup(function (e) { @@ -287,4 +289,6 @@ BI.BasicButton = BI.inherit(BI.Single, { BI.BasicButton.superclass.destroy.apply(this, arguments); } }); -BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; \ No newline at end of file +BI.BasicButton.EVENT_CHANGE = "BasicButton.EVENT_CHANGE"; +BI.BasicButton.EVENT_MOUSE_DOWN = "BasicButton.EVENT_MOUSE_DOWN"; +BI.BasicButton.EVENT_MOUSE_UP = "BasicButton.EVENT_MOUSE_UP"; \ No newline at end of file diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index e6cf5e6ad..331bbec99 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -209,38 +209,6 @@ .bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { color: #666666 !important; } -.bi-list-item-hover:hover, -.bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #eff1f4; -} -.bi-list-item-hover.disabled, -.bi-list-item-hover.disabled:hover, -.bi-list-item-hover.disabled:active { - color: #cccccc !important; - background-color: transparent !important; -} -.bi-list-item-hover.disabled .bi-high-light, -.bi-list-item-hover.disabled:hover .bi-high-light, -.bi-list-item-hover.disabled:active .bi-high-light { - color: #cccccc !important; -} -.bi-theme-dark .bi-list-item-hover:hover, -.bi-theme-dark .bi-list-item-hover.hover { - color: #3f8ce8; - background-color: #191b2b; -} -.bi-theme-dark .bi-list-item-hover.disabled, -.bi-theme-dark .bi-list-item-hover.disabled:hover, -.bi-theme-dark .bi-list-item-hover.disabled:active { - background-color: transparent !important; - color: #666666 !important; -} -.bi-theme-dark .bi-list-item-hover.disabled .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:hover .bi-high-light, -.bi-theme-dark .bi-list-item-hover.disabled:active .bi-high-light { - color: #666666 !important; -} .bi-list-item-active:hover, .bi-list-item-active.hover { color: #1a1a1a; @@ -333,6 +301,9 @@ .bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-choose:hover { + color: #1a1a1a; +} .bi-list-item-choose:active, .bi-list-item-choose.active { color: #ffffff; @@ -353,3 +324,17 @@ .bi-list-item-choose.disabled:active .bi-high-light { color: #cccccc !important; } +.bi-theme-dark .bi-list-item-choose:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-choose.disabled, +.bi-theme-dark .bi-list-item-choose.disabled:hover, +.bi-theme-dark .bi-list-item-choose.disabled:active { + color: #666666 !important; + background-color: transparent !important; +} +.bi-theme-dark .bi-list-item-choose.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-choose.disabled:active .bi-high-light { + color: #666666 !important; +} diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index fbfe3a2b8..231eb9603 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -267,41 +267,6 @@ } } -//文字和背景hover时变化 -.bi-list-item-hover { - &:hover, &.hover { - color: @color-bi-text-highlight; - background-color: @color-bi-background-normal; - } - &.disabled { - &, &:hover, &:active { - color: @color-bi-text-disabled !important; - background-color: transparent !important; - & .bi-high-light { - color: @color-bi-text-disabled !important; - } - } - } -} - -.bi-theme-dark { - .bi-list-item-hover { - &:hover, &.hover { - color: @color-bi-text-highlight; - background-color: @color-bi-background-normal-theme-dark; - } - &.disabled { - &, &:hover, &:active { - background-color: transparent !important; - color: @color-bi-text-disabled-theme-dark !important; - & .bi-high-light { - color: @color-bi-text-disabled-theme-dark !important; - } - } - } - } -} - //文字和背景hover和active时变化 .bi-list-item-active { &:hover, &.hover { @@ -395,6 +360,9 @@ } .bi-list-item-choose { + &:hover { + color: @color-bi-text-black; + } &:active, &.active { color: @color-bi-text; background-color: @color-bi-background-highlight; @@ -411,4 +379,21 @@ } } } +} + +.bi-theme-dark { + .bi-list-item-choose { + &:hover { + color: @color-bi-text; + } + &.disabled { + &, &:hover, &:active { + color: @color-bi-text-disabled-theme-dark !important; + background-color: transparent !important; + & .bi-high-light { + color: @color-bi-text-disabled-theme-dark !important; + } + } + } + } } \ No newline at end of file