From a234d9b0dec12b0a5c6c83d6ce0b0ed8c3df91a7 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 10 Aug 2019 16:01:09 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=90=8C=E6=AD=A5longbow-select?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/longbow-select/longbow-select.css | 97 +++++++++---------- .../lib/longbow-select/longbow-select.js | 44 +++------ 2 files changed, 58 insertions(+), 83 deletions(-) diff --git a/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.css b/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.css index b0cb80ca..21617440 100644 --- a/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.css +++ b/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.css @@ -1,63 +1,54 @@ -.form-select { - position: relative; +.form-select .dropdown-menu { + margin-top: 10px; + max-height: 274px; + overflow-x: hidden; + padding: 0.25rem 0; + width: 100%; } - .form-select .dropdown-menu { - margin-top: 14px; - max-height: 274px; - overflow-x: hidden; - padding: 0.25rem 0; - } +.form-select .dropdown-menu-arrow { + width: 0; + height: 0; + border-width: 0 6px 6px; + border-style: solid; + border-color: transparent transparent rgba(0,0,0,.15); + position: absolute; + left: 20px; + margin-top: 4px; + z-index: 1001; + display: none; +} - .form-select .dropdown-menu-arrow { + .form-select .dropdown-menu-arrow:after { + content: " "; width: 0; height: 0; border-width: 0 6px 6px; border-style: solid; - border-color: transparent transparent rgba(0,0,0,.15); + border-color: transparent transparent #fff; position: absolute; - left: 20px; - z-index: 1001; - margin-top: 8px; + top: 1px; + left: -6px; } - .form-select .dropdown-menu, .form-select .dropdown-menu-arrow { - display: none; - opacity: 0; - transition: opacity .3s; - } +.form-select .form-select-input[readonly] { + background-color: #fff; +} - .form-select .dropdown-menu-arrow:after { - content: " "; - width: 0; - height: 0; - border-width: 0 6px 6px; - border-style: solid; - border-color: transparent transparent #fff; - position: absolute; - top: 1px; - left: -6px; - } +.form-select.show .dropdown-menu-arrow { + display: block; +} - .form-select .form-select-input[readonly] { - background-color: #fff; - } - - .form-select.open .dropdown-menu, .form-select.open .dropdown-menu-arrow { - display: block; - opacity: 1; - } +.form-select.show .form-select-append i { + transform: rotate(0); +} - .form-select.open .form-select-append i { - transform: rotate(0); - } - - .form-select.is-disabled .form-select-input { - background-color: #f5f7fa; - border-color: #e4e7ed; - color: #c0c4cc; - cursor: not-allowed; - } +.form-select.is-disabled .form-select-input { + background-color: #f5f7fa; + border-color: #e4e7ed; + color: #c0c4cc; + cursor: not-allowed; +} .form-select-input { color: #606266; @@ -102,17 +93,17 @@ border-color: #dc3545; } - .form-select-input.is-invalid + .form-select-append { - color: #dc3545; - } + .form-select-input.is-invalid + .form-select-append { + color: #dc3545; + } .form-select-input.is-valid:hover { border-color: #28a745; } - .form-select-input.is-valid + .form-select-append { - color: #28a745; - } + .form-select-input.is-valid + .form-select-append { + color: #28a745; + } input.form-control[data-toggle='lgbSelect'] { width: 210px; diff --git a/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js b/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js index b36828aa..3ca77918 100644 --- a/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js +++ b/Bootstrap.Admin/wwwroot/lib/longbow-select/longbow-select.js @@ -10,8 +10,7 @@ lgbSelect.VERSION = '1.0'; lgbSelect.Author = 'argo@163.com'; lgbSelect.DataKey = "lgb.select"; - lgbSelect.Template = '
'; - lgbSelect.Template += ''; + lgbSelect.Template = '