BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
06239e13
Commit
06239e13
authored
Feb 15, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move necessary sidebar code to right_sidebar.js; delete sidebar.js
parent
20d61363
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
22 deletions
+12
-22
application.js
app/assets/javascripts/application.js
+0
-2
right_sidebar.js
app/assets/javascripts/right_sidebar.js
+12
-0
sidebar.js.es6
app/assets/javascripts/sidebar.js.es6
+0
-20
No files found.
app/assets/javascripts/application.js
View file @
06239e13
...
...
@@ -240,8 +240,6 @@ require('es6-promise').polyfill();
});
gl
.
awardsHandler
=
new
AwardsHandler
();
new
Aside
();
// bind sidebar events
new
gl
.
Sidebar
();
gl
.
utils
.
initTimeagoTimeout
();
});
...
...
app/assets/javascripts/right_sidebar.js
View file @
06239e13
...
...
@@ -25,6 +25,8 @@
$
(
'.dropdown'
).
on
(
'hidden.gl.dropdown'
,
this
,
this
.
onSidebarDropdownHidden
);
$
(
'.dropdown'
).
on
(
'loading.gl.dropdown'
,
this
.
sidebarDropdownLoading
);
$
(
'.dropdown'
).
on
(
'loaded.gl.dropdown'
,
this
.
sidebarDropdownLoaded
);
$
(
window
).
on
(
'resize'
,
()
=>
this
.
setSidebarHeight
());
$
(
document
).
on
(
'scroll'
,
()
=>
this
.
setSidebarHeight
());
$
(
document
).
on
(
'click'
,
'.js-sidebar-toggle'
,
function
(
e
,
triggered
)
{
var
$allGutterToggleIcons
,
$this
,
$thisIcon
;
e
.
preventDefault
();
...
...
@@ -191,6 +193,16 @@
}
};
Sidebar
.
prototype
.
setSidebarHeight
=
function
()
{
const
$navHeight
=
$
(
'.navbar-gitlab'
).
outerHeight
()
+
$
(
'.layout-nav'
).
outerHeight
();
const
diff
=
$navHeight
-
$
(
'body'
).
scrollTop
();
if
(
diff
>
0
)
{
$
(
'.js-right-sidebar'
).
outerHeight
(
$
(
window
).
height
()
-
diff
);
}
else
{
$
(
'.js-right-sidebar'
).
outerHeight
(
'100%'
);
}
};
Sidebar
.
prototype
.
isOpen
=
function
()
{
return
this
.
sidebar
.
is
(
'.right-sidebar-expanded'
);
};
...
...
app/assets/javascripts/sidebar.js.es6
deleted
100644 → 0
View file @
20d61363
/* eslint-disable arrow-parens, class-methods-use-this, no-param-reassign */
/* global Cookies */
(() => {
class Sidebar {
setSidebarHeight() {
const $navHeight = $('.navbar-gitlab').outerHeight() + $('.layout-nav').outerHeight();
const diff = $navHeight - $('body').scrollTop();
if (diff > 0) {
$('.js-right-sidebar').outerHeight($(window).height() - diff);
} else {
$('.js-right-sidebar').outerHeight('100%');
}
}
}
window.gl = window.gl || {};
gl.Sidebar = Sidebar;
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment