Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
454c79fc
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,发现更多精彩内容 >>
提交
454c79fc
编写于
6月 20, 2017
作者:
T
Tim Zallmann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes scrolling + improves Performance through assigning found $ elements to variables
上级
27664b7d
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
16 addition
and
7 deletion
+16
-7
app/assets/javascripts/right_sidebar.js
app/assets/javascripts/right_sidebar.js
+15
-6
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+1
-1
未找到文件。
app/assets/javascripts/right_sidebar.js
浏览文件 @
454c79fc
...
@@ -7,6 +7,13 @@ import Cookies from 'js-cookie';
...
@@ -7,6 +7,13 @@ import Cookies from 'js-cookie';
function
Sidebar
(
currentUser
)
{
function
Sidebar
(
currentUser
)
{
this
.
toggleTodo
=
this
.
toggleTodo
.
bind
(
this
);
this
.
toggleTodo
=
this
.
toggleTodo
.
bind
(
this
);
this
.
sidebar
=
$
(
'
aside
'
);
this
.
sidebar
=
$
(
'
aside
'
);
this
.
$sidebarInner
=
this
.
sidebar
.
find
(
'
.issuable-sidebar
'
);
this
.
$navGitlab
=
$
(
'
.navbar-gitlab
'
);
this
.
$layoutNav
=
$
(
'
.layout-nav
'
);
this
.
$subScroll
=
$
(
'
.sub-nav-scroll
'
);
this
.
$rightSidebar
=
$
(
'
.js-right-sidebar
'
);
this
.
removeListeners
();
this
.
removeListeners
();
this
.
addEventListeners
();
this
.
addEventListeners
();
}
}
...
@@ -21,14 +28,15 @@ import Cookies from 'js-cookie';
...
@@ -21,14 +28,15 @@ import Cookies from 'js-cookie';
Sidebar
.
prototype
.
addEventListeners
=
function
()
{
Sidebar
.
prototype
.
addEventListeners
=
function
()
{
const
$document
=
$
(
document
);
const
$document
=
$
(
document
);
const
throttledSetSidebarHeight
=
_
.
throttle
(
this
.
setSidebarHeight
,
10
);
const
throttledSetSidebarHeight
=
_
.
throttle
(
this
.
setSidebarHeight
.
bind
(
this
),
20
);
const
debouncedSetSidebarHeight
=
_
.
debounce
(
this
.
setSidebarHeight
.
bind
(
this
),
200
);
this
.
sidebar
.
on
(
'
click
'
,
'
.sidebar-collapsed-icon
'
,
this
,
this
.
sidebarCollapseClicked
);
this
.
sidebar
.
on
(
'
click
'
,
'
.sidebar-collapsed-icon
'
,
this
,
this
.
sidebarCollapseClicked
);
$
(
'
.dropdown
'
).
on
(
'
hidden.gl.dropdown
'
,
this
,
this
.
onSidebarDropdownHidden
);
$
(
'
.dropdown
'
).
on
(
'
hidden.gl.dropdown
'
,
this
,
this
.
onSidebarDropdownHidden
);
$
(
'
.dropdown
'
).
on
(
'
loading.gl.dropdown
'
,
this
.
sidebarDropdownLoading
);
$
(
'
.dropdown
'
).
on
(
'
loading.gl.dropdown
'
,
this
.
sidebarDropdownLoading
);
$
(
'
.dropdown
'
).
on
(
'
loaded.gl.dropdown
'
,
this
.
sidebarDropdownLoaded
);
$
(
'
.dropdown
'
).
on
(
'
loaded.gl.dropdown
'
,
this
.
sidebarDropdownLoaded
);
$
(
window
).
on
(
'
resize
'
,
()
=>
throttledSetSidebarHeight
());
$
(
window
).
on
(
'
resize
'
,
()
=>
throttledSetSidebarHeight
());
$document
.
on
(
'
scroll
'
,
()
=>
throttl
edSetSidebarHeight
());
$document
.
on
(
'
scroll
'
,
()
=>
debounc
edSetSidebarHeight
());
$document
.
on
(
'
click
'
,
'
.js-sidebar-toggle
'
,
function
(
e
,
triggered
)
{
$document
.
on
(
'
click
'
,
'
.js-sidebar-toggle
'
,
function
(
e
,
triggered
)
{
var
$allGutterToggleIcons
,
$this
,
$thisIcon
;
var
$allGutterToggleIcons
,
$this
,
$thisIcon
;
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -207,13 +215,14 @@ import Cookies from 'js-cookie';
...
@@ -207,13 +215,14 @@ import Cookies from 'js-cookie';
};
};
Sidebar
.
prototype
.
setSidebarHeight
=
function
()
{
Sidebar
.
prototype
.
setSidebarHeight
=
function
()
{
const
$navHeight
=
$
(
'
.navbar-gitlab
'
).
outerHeight
()
+
$
(
'
.layout-nav
'
).
outerHeight
()
+
$
(
'
.sub-nav-scroll
'
).
outerHeight
();
const
$navHeight
=
this
.
$navGitlab
.
outerHeight
()
+
this
.
$layoutNav
.
outerHeight
()
+
(
this
.
$subScroll
?
this
.
$subScroll
.
outerHeight
()
:
0
);
const
$rightSidebar
=
$
(
'
.js-right-sidebar
'
);
const
diff
=
$navHeight
-
$
(
window
).
scrollTop
();
const
diff
=
$navHeight
-
$
(
window
).
scrollTop
();
if
(
diff
>
0
)
{
if
(
diff
>
0
)
{
$rightSidebar
.
outerHeight
(
$
(
window
).
height
()
-
diff
);
this
.
$rightSidebar
.
outerHeight
(
$
(
window
).
height
()
-
diff
);
this
.
$sidebarInner
.
height
(
'
100%
'
);
}
else
{
}
else
{
$rightSidebar
.
outerHeight
(
'
100%
'
);
this
.
$rightSidebar
.
outerHeight
(
'
100%
'
);
this
.
$sidebarInner
.
height
(
''
);
}
}
};
};
...
...
app/assets/stylesheets/pages/issuable.scss
浏览文件 @
454c79fc
...
@@ -204,7 +204,7 @@
...
@@ -204,7 +204,7 @@
.issuable-sidebar
{
.issuable-sidebar
{
width
:
calc
(
100%
+
100px
);
width
:
calc
(
100%
+
100px
);
height
:
100%
;
height
:
calc
(
100%
-
#{
$header-height
}
)
;
overflow-y
:
scroll
;
overflow-y
:
scroll
;
overflow-x
:
hidden
;
overflow-x
:
hidden
;
-webkit-overflow-scrolling
:
touch
;
-webkit-overflow-scrolling
:
touch
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录