瀏覽代碼

Merge pull request #70 from xinjinzhang/optimize-mapswitch-display

MapSwitch折行和右边多出5px空间问题
tags/2.6.0
Caven Chen 4 年之前
父節點
當前提交
b516f41e4a
No account linked to committer's email address
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 2
    0
      modules/themes/mapswitch.scss
  2. 2
    1
      modules/widget/type/MapSwitch.js

+ 2
- 0
modules/themes/mapswitch.scss 查看文件

@@ -10,7 +10,9 @@
-webkit-transition: width 2s; /* Safari and Chrome */
-o-transition: width 2s; /* Opera */
padding: 5px 5px;
box-sizing: content-box;
box-shadow: 2px 2px 3px #888888;
white-space: nowrap;
cursor: pointer;
overflow: hidden;
visibility: hidden;

+ 2
- 1
modules/widget/type/MapSwitch.js 查看文件

@@ -43,8 +43,9 @@ class MapSwitch extends Widget {
let self = this
this._wrapper.onmouseover = () => {
let width = 80
let rightMargin = 5
if (self._cache.length > 0) {
width = self._cache.length * 85
width = self._cache.length * (width+rightMargin) - rightMargin
}
this._wrapper.style.width = `${width}px`
}

Loading…
取消
儲存