From 39e4416dadc47c4941cb9ec9f1b09c11cbe6ffb3 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 9 May 2017 09:17:40 +0800 Subject: [PATCH] add --- bi/base.css | 3 -- bi/case.js | 8 ++-- bi/core.css | 49 ++++++++++++++++++++ bi/core.js | 5 +- docs/base.css | 3 -- docs/case.js | 8 ++-- docs/core.css | 49 ++++++++++++++++++++ docs/core.js | 5 +- src/case/combo/bubblecombo/combo.bubble.js | 2 +- src/case/combo/bubblecombo/popup.bubble.js | 2 +- src/case/loader/sort.list.js | 4 +- src/core/controller/router.floatbox.js | 2 +- src/core/func/function.js | 3 ++ src/css/base/combo/popup.bubble.css | 3 -- src/css/core/utils/common.css | 49 ++++++++++++++++++++ src/less/base/combo/popup.bubble.less | 3 -- src/less/core/utils/common.less | 53 ++++++++++++++++++++++ 17 files changed, 224 insertions(+), 27 deletions(-) diff --git a/bi/base.css b/bi/base.css index db45a61df..c9c048d61 100644 --- a/bi/base.css +++ b/bi/base.css @@ -68,9 +68,6 @@ -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } -.bi-bubble-popup-view .bubble-popup-line { - background-color: #3f8ce8; -} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/bi/case.js b/bi/case.js index e8cc8687b..4b90d1a05 100644 --- a/bi/case.js +++ b/bi/case.js @@ -3527,7 +3527,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { type: "bi.center_adapt", items: [{ type: "bi.layout", - cls: "bubble-combo-triangle-" + direction + cls: "bubble-combo-triangle-" + direction + " bi-high-light-border" }] }); pos.el = this.triangle; @@ -3663,7 +3663,7 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, { } this.line = BI.createWidget(op, { type: "bi.layout", - cls: "bubble-popup-line" + cls: "bubble-popup-line bi-high-light-background" }); pos.el = this.line; BI.createWidget({ @@ -7897,8 +7897,8 @@ BI.SortList = BI.inherit(BI.Widget, { containment: o.containment || this.element, connectWith: o.connectWith || ".bi-sort-list", items: ".sort-item", - cursor: "drag", - tolerance: "intersect", + cursor: o.cursor || "drag", + tolerance: o.tolerance || "intersect", placeholder: { element: function ($currentItem) { var holder = BI.createWidget({ diff --git a/bi/core.css b/bi/core.css index c1006d617..ed35e8965 100644 --- a/bi/core.css +++ b/bi/core.css @@ -3047,6 +3047,9 @@ i { background-color: #3f8ce8; color: #ffffff; } +.bi-high-light-border { + border-color: #178cdf; +} .bi-water-mark { color: #cccccc; cursor: text; @@ -3112,6 +3115,10 @@ i { .bi-theme-dark .bi-list-item.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-border:active, +.bi-list-item-border.active { + border: 1px solid #178cdf; +} .bi-list-item-simple { color: #999999; } @@ -3210,6 +3217,48 @@ i { .bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-active2:hover, +.bi-list-item-active2.hover { + color: #1a1a1a; + background-color: #ffffff; +} +.bi-list-item-active2.active, +.bi-list-item-active2:active { + color: #3f8ce8; + background-color: #ffffff; +} +.bi-list-item-active2.disabled, +.bi-list-item-active2.disabled:hover, +.bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #cccccc !important; +} +.bi-list-item-active2.disabled .bi-high-light, +.bi-list-item-active2.disabled:hover .bi-high-light, +.bi-list-item-active2.disabled:active .bi-high-light { + color: #cccccc !important; +} +.bi-theme-dark .bi-list-item-active2:hover, +.bi-theme-dark .bi-list-item-active2.hover { + color: #ffffff; + background-color: #242640; +} +.bi-theme-dark .bi-list-item-active2.active, +.bi-theme-dark .bi-list-item-active2:active { + color: #3f8ce8; + background-color: #242640; +} +.bi-theme-dark .bi-list-item-active2.disabled, +.bi-theme-dark .bi-list-item-active2.disabled:hover, +.bi-theme-dark .bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light { + color: #666666 !important; +} .bi-list-item-select:hover, .bi-list-item-select.hover { color: #1a1a1a; diff --git a/bi/core.js b/bi/core.js index be8b58fb8..d9254f202 100644 --- a/bi/core.js +++ b/bi/core.js @@ -16333,7 +16333,7 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, { if(this.controller){ this.controller.remove(url); delete this.store[url]; - this.views[url] && this.views[url].destroy(); + this.views[url] && this.views[url].model.destroy(); delete this.views[url]; } return this; @@ -17163,6 +17163,9 @@ $(function () { //获取对比颜色 getContrastColor: function (color) { + if (!color) { + return ""; + } if (this.isDarkColor(color)) { return "#ffffff"; } diff --git a/docs/base.css b/docs/base.css index db45a61df..c9c048d61 100644 --- a/docs/base.css +++ b/docs/base.css @@ -68,9 +68,6 @@ -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } -.bi-bubble-popup-view .bubble-popup-line { - background-color: #3f8ce8; -} /****添加计算宽度的--运算符直接需要space****/ /****** common color(常用颜色,可用于普遍场景) *****/ /**** custom color(自定义颜色,用于特定场景) ****/ diff --git a/docs/case.js b/docs/case.js index e8cc8687b..4b90d1a05 100644 --- a/docs/case.js +++ b/docs/case.js @@ -3527,7 +3527,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { type: "bi.center_adapt", items: [{ type: "bi.layout", - cls: "bubble-combo-triangle-" + direction + cls: "bubble-combo-triangle-" + direction + " bi-high-light-border" }] }); pos.el = this.triangle; @@ -3663,7 +3663,7 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, { } this.line = BI.createWidget(op, { type: "bi.layout", - cls: "bubble-popup-line" + cls: "bubble-popup-line bi-high-light-background" }); pos.el = this.line; BI.createWidget({ @@ -7897,8 +7897,8 @@ BI.SortList = BI.inherit(BI.Widget, { containment: o.containment || this.element, connectWith: o.connectWith || ".bi-sort-list", items: ".sort-item", - cursor: "drag", - tolerance: "intersect", + cursor: o.cursor || "drag", + tolerance: o.tolerance || "intersect", placeholder: { element: function ($currentItem) { var holder = BI.createWidget({ diff --git a/docs/core.css b/docs/core.css index c1006d617..ed35e8965 100644 --- a/docs/core.css +++ b/docs/core.css @@ -3047,6 +3047,9 @@ i { background-color: #3f8ce8; color: #ffffff; } +.bi-high-light-border { + border-color: #178cdf; +} .bi-water-mark { color: #cccccc; cursor: text; @@ -3112,6 +3115,10 @@ i { .bi-theme-dark .bi-list-item.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-border:active, +.bi-list-item-border.active { + border: 1px solid #178cdf; +} .bi-list-item-simple { color: #999999; } @@ -3210,6 +3217,48 @@ i { .bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-active2:hover, +.bi-list-item-active2.hover { + color: #1a1a1a; + background-color: #ffffff; +} +.bi-list-item-active2.active, +.bi-list-item-active2:active { + color: #3f8ce8; + background-color: #ffffff; +} +.bi-list-item-active2.disabled, +.bi-list-item-active2.disabled:hover, +.bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #cccccc !important; +} +.bi-list-item-active2.disabled .bi-high-light, +.bi-list-item-active2.disabled:hover .bi-high-light, +.bi-list-item-active2.disabled:active .bi-high-light { + color: #cccccc !important; +} +.bi-theme-dark .bi-list-item-active2:hover, +.bi-theme-dark .bi-list-item-active2.hover { + color: #ffffff; + background-color: #242640; +} +.bi-theme-dark .bi-list-item-active2.active, +.bi-theme-dark .bi-list-item-active2:active { + color: #3f8ce8; + background-color: #242640; +} +.bi-theme-dark .bi-list-item-active2.disabled, +.bi-theme-dark .bi-list-item-active2.disabled:hover, +.bi-theme-dark .bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light { + color: #666666 !important; +} .bi-list-item-select:hover, .bi-list-item-select.hover { color: #1a1a1a; diff --git a/docs/core.js b/docs/core.js index 5801660c2..ca61c1ec3 100644 --- a/docs/core.js +++ b/docs/core.js @@ -21434,7 +21434,7 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, { if(this.controller){ this.controller.remove(url); delete this.store[url]; - this.views[url] && this.views[url].destroy(); + this.views[url] && this.views[url].model.destroy(); delete this.views[url]; } return this; @@ -22689,6 +22689,9 @@ $(function () { //获取对比颜色 getContrastColor: function (color) { + if (!color) { + return ""; + } if (this.isDarkColor(color)) { return "#ffffff"; } diff --git a/src/case/combo/bubblecombo/combo.bubble.js b/src/case/combo/bubblecombo/combo.bubble.js index 5b257f17c..a725567aa 100644 --- a/src/case/combo/bubblecombo/combo.bubble.js +++ b/src/case/combo/bubblecombo/combo.bubble.js @@ -128,7 +128,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, { type: "bi.center_adapt", items: [{ type: "bi.layout", - cls: "bubble-combo-triangle-" + direction + cls: "bubble-combo-triangle-" + direction + " bi-high-light-border" }] }); pos.el = this.triangle; diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index 499db968e..5ab6352ba 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -55,7 +55,7 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, { } this.line = BI.createWidget(op, { type: "bi.layout", - cls: "bubble-popup-line" + cls: "bubble-popup-line bi-high-light-background" }); pos.el = this.line; BI.createWidget({ diff --git a/src/case/loader/sort.list.js b/src/case/loader/sort.list.js index 333d54691..776434140 100644 --- a/src/case/loader/sort.list.js +++ b/src/case/loader/sort.list.js @@ -60,8 +60,8 @@ BI.SortList = BI.inherit(BI.Widget, { containment: o.containment || this.element, connectWith: o.connectWith || ".bi-sort-list", items: ".sort-item", - cursor: "drag", - tolerance: "intersect", + cursor: o.cursor || "drag", + tolerance: o.tolerance || "intersect", placeholder: { element: function ($currentItem) { var holder = BI.createWidget({ diff --git a/src/core/controller/router.floatbox.js b/src/core/controller/router.floatbox.js index 7880caa3e..1076b0424 100644 --- a/src/core/controller/router.floatbox.js +++ b/src/core/controller/router.floatbox.js @@ -87,7 +87,7 @@ BI.FloatBoxRouter = BI.inherit(BI.WRouter, { if(this.controller){ this.controller.remove(url); delete this.store[url]; - this.views[url] && this.views[url].destroy(); + this.views[url] && this.views[url].model.destroy(); delete this.views[url]; } return this; diff --git a/src/core/func/function.js b/src/core/func/function.js index 7d8421890..d212ba5f4 100644 --- a/src/core/func/function.js +++ b/src/core/func/function.js @@ -137,6 +137,9 @@ $(function () { //获取对比颜色 getContrastColor: function (color) { + if (!color) { + return ""; + } if (this.isDarkColor(color)) { return "#ffffff"; } diff --git a/src/css/base/combo/popup.bubble.css b/src/css/base/combo/popup.bubble.css index b3791009d..c1a8d419c 100644 --- a/src/css/base/combo/popup.bubble.css +++ b/src/css/base/combo/popup.bubble.css @@ -6,6 +6,3 @@ -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } -.bi-bubble-popup-view .bubble-popup-line { - background-color: #3f8ce8; -} diff --git a/src/css/core/utils/common.css b/src/css/core/utils/common.css index 9094a1813..23ca02db3 100644 --- a/src/css/core/utils/common.css +++ b/src/css/core/utils/common.css @@ -94,6 +94,9 @@ background-color: #3f8ce8; color: #ffffff; } +.bi-high-light-border { + border-color: #178cdf; +} .bi-water-mark { color: #cccccc; cursor: text; @@ -159,6 +162,10 @@ .bi-theme-dark .bi-list-item.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-border:active, +.bi-list-item-border.active { + border: 1px solid #178cdf; +} .bi-list-item-simple { color: #999999; } @@ -257,6 +264,48 @@ .bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light { color: #666666 !important; } +.bi-list-item-active2:hover, +.bi-list-item-active2.hover { + color: #1a1a1a; + background-color: #ffffff; +} +.bi-list-item-active2.active, +.bi-list-item-active2:active { + color: #3f8ce8; + background-color: #ffffff; +} +.bi-list-item-active2.disabled, +.bi-list-item-active2.disabled:hover, +.bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #cccccc !important; +} +.bi-list-item-active2.disabled .bi-high-light, +.bi-list-item-active2.disabled:hover .bi-high-light, +.bi-list-item-active2.disabled:active .bi-high-light { + color: #cccccc !important; +} +.bi-theme-dark .bi-list-item-active2:hover, +.bi-theme-dark .bi-list-item-active2.hover { + color: #ffffff; + background-color: #242640; +} +.bi-theme-dark .bi-list-item-active2.active, +.bi-theme-dark .bi-list-item-active2:active { + color: #3f8ce8; + background-color: #242640; +} +.bi-theme-dark .bi-list-item-active2.disabled, +.bi-theme-dark .bi-list-item-active2.disabled:hover, +.bi-theme-dark .bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #666666 !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light { + color: #666666 !important; +} .bi-list-item-select:hover, .bi-list-item-select.hover { color: #1a1a1a; diff --git a/src/less/base/combo/popup.bubble.less b/src/less/base/combo/popup.bubble.less index 6c5ec1313..4a6a7c469 100644 --- a/src/less/base/combo/popup.bubble.less +++ b/src/less/base/combo/popup.bubble.less @@ -1,8 +1,5 @@ @import "../../bibase"; .bi-bubble-popup-view { - & .bubble-popup-line { - background-color: @color-bi-background-highlight; - } .box-shadow(0 0 10px, rgba(0, 0, 0, 0.2)); } \ No newline at end of file diff --git a/src/less/core/utils/common.less b/src/less/core/utils/common.less index 4402ddab2..6537c9d8e 100644 --- a/src/less/core/utils/common.less +++ b/src/less/core/utils/common.less @@ -132,6 +132,10 @@ color: @color-bi-text; } +.bi-high-light-border { + border-color: @color-bi-border-highlight; +} + //水印 .bi-water-mark { color: @water-mark-color; @@ -209,6 +213,12 @@ } } +.bi-list-item-border { + &:active, &.active { + border: 1px solid @color-bi-border-highlight; + } +} + //极简 .bi-list-item-simple { color: @color-bi-text-tips; @@ -306,6 +316,49 @@ } } +//文字和背景hover和active时变化 +.bi-list-item-active2 { + &:hover, &.hover { + color: @color-bi-text-black; + background-color: @color-bi-background-default; + } + &.active, &:active { + color: @color-bi-text-highlight; + background-color: @color-bi-background-default; + } + &.disabled { + &, &:hover, &:active { + background-color: transparent !important; + color: @color-bi-text-disabled !important; + & .bi-high-light { + color: @color-bi-text-disabled !important; + } + } + } +} + +.bi-theme-dark { + .bi-list-item-active2 { + &:hover, &.hover { + color: @color-bi-text; + background-color: @color-bi-background-default-theme-dark; + } + &.active, &:active { + color: @color-bi-text-highlight; + background-color: @color-bi-background-default-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; + } + } + } + } +} + //有选中效果 .bi-list-item-select { &:hover, &.hover {