Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0925edb4
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0925edb4
编写于
7月 19, 2017
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updated styles
上级
75054174
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
49 deletion
+13
-49
app/assets/javascripts/fly_out_nav.js
app/assets/javascripts/fly_out_nav.js
+1
-14
app/assets/stylesheets/new_sidebar.scss
app/assets/stylesheets/new_sidebar.scss
+11
-22
spec/javascripts/fly_out_nav_spec.js
spec/javascripts/fly_out_nav_spec.js
+1
-13
未找到文件。
app/assets/javascripts/fly_out_nav.js
浏览文件 @
0925edb4
...
...
@@ -5,12 +5,7 @@ export const calculateTop = (boundingRect, outerHeight) => {
return
bottomOverflow
<
0
?
boundingRect
.
top
-
Math
.
abs
(
bottomOverflow
)
:
boundingRect
.
top
;
};
export
const
createArrowStyles
=
(
boundingRect
,
top
)
=>
`.sidebar-sub-level-items::before { transform: translate3d(0,
${
boundingRect
.
top
-
top
}
px, 0); }`
;
export
default
()
=>
{
const
style
=
document
.
createElement
(
'
style
'
);
document
.
head
.
appendChild
(
style
);
$
(
'
.sidebar-top-level-items > li:not(.active)
'
).
on
(
'
mouseover
'
,
(
e
)
=>
{
const
$this
=
e
.
currentTarget
;
const
$subitems
=
$
(
'
.sidebar-sub-level-items
'
,
$this
).
show
();
...
...
@@ -22,14 +17,6 @@ export default () => {
$subitems
.
css
({
transform
:
`translate3d(0,
${
top
}
px, 0)`
,
});
style
.
sheet
.
insertRule
(
createArrowStyles
(
boundingRect
,
top
),
0
);
}
}).
on
(
'
mouseout
'
,
(
e
)
=>
{
$
(
'
.sidebar-sub-level-items
'
,
e
.
currentTarget
).
hide
();
if
(
style
.
sheet
.
rules
.
length
)
{
style
.
sheet
.
deleteRule
(
0
);
}
});
})
.
on
(
'
mouseout
'
,
e
=>
$
(
'
.sidebar-sub-level-items
'
,
e
.
currentTarget
).
hide
())
;
};
app/assets/stylesheets/new_sidebar.scss
浏览文件 @
0925edb4
...
...
@@ -151,6 +151,12 @@ $new-sidebar-width: 220px;
.sidebar-top-level-items
{
>
li
{
>
a
{
@media
(
min-width
:
$screen-sm-min
)
{
margin-right
:
2px
;
}
}
&
:not
(
.active
)
{
.sidebar-sub-level-items
{
@media
(
min-width
:
$screen-sm-min
)
{
...
...
@@ -158,43 +164,26 @@ $new-sidebar-width: 220px;
top
:
0
;
left
:
220px
;
width
:
150px
;
margin-left
:
-1px
;
padding-bottom
:
0
;
background-color
:
$white-light
;
background-color
:
$hover-background
;
box-shadow
:
2px
1px
3px
$dropdown-shadow-color
;
border
:
1px
solid
$dropdown-border-color
;
border-left
:
0
;
&
::before
{
content
:
""
;
position
:
absolute
;
left
:
0
;
top
:
0
;
width
:
0
;
height
:
0
;
border-style
:
solid
;
border-width
:
21px
12px
;
border-color
:
transparent
transparent
transparent
$hover-background
;
pointer-events
:
none
;
}
border-radius
:
0
3px
3px
0
;
&
::after
{
content
:
""
;
position
:
absolute
;
top
:
44px
;
left
:
-
2
0px
;
left
:
-
3
0px
;
right
:
0
;
bottom
:
0
;
z-index
:
-1
;
}
a
{
padding
:
11px
16px
11px
24px
;
color
:
$white-light
;
&
:hover
,
&
:focus
{
background
:
transparent
;
font-weight
:
600
;
background-color
:
darken
(
$hover-background
,
10%
);
}
}
}
...
...
spec/javascripts/fly_out_nav_spec.js
浏览文件 @
0925edb4
import
{
calculateTop
,
createArrowStyles
}
from
'
~/fly_out_nav
'
;
import
{
calculateTop
}
from
'
~/fly_out_nav
'
;
describe
(
'
Fly out sidebar navigation
'
,
()
=>
{
describe
(
'
calculateTop
'
,
()
=>
{
...
...
@@ -22,16 +22,4 @@ describe('Fly out sidebar navigation', () => {
).
toBe
(
window
.
innerHeight
-
100
);
});
});
describe
(
'
createArrowStyles
'
,
()
=>
{
it
(
'
returns translate3d styles
'
,
()
=>
{
const
boundingRect
=
{
top
:
100
,
};
expect
(
createArrowStyles
(
boundingRect
,
50
),
).
toContain
(
'
translate3d(0, 50px, 0)
'
);
});
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录