Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
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
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
22 deletions
+12
-22
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+0
-2
app/assets/javascripts/right_sidebar.js
app/assets/javascripts/right_sidebar.js
+12
-0
app/assets/javascripts/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();
...
@@ -240,8 +240,6 @@ require('es6-promise').polyfill();
});
});
gl
.
awardsHandler
=
new
AwardsHandler
();
gl
.
awardsHandler
=
new
AwardsHandler
();
new
Aside
();
new
Aside
();
// bind sidebar events
new
gl
.
Sidebar
();
gl
.
utils
.
initTimeagoTimeout
();
gl
.
utils
.
initTimeagoTimeout
();
});
});
...
...
app/assets/javascripts/right_sidebar.js
View file @
06239e13
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
$
(
'
.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
'
,
()
=>
this
.
setSidebarHeight
());
$
(
document
).
on
(
'
scroll
'
,
()
=>
this
.
setSidebarHeight
());
$
(
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
();
...
@@ -191,6 +193,16 @@
...
@@ -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
()
{
Sidebar
.
prototype
.
isOpen
=
function
()
{
return
this
.
sidebar
.
is
(
'
.right-sidebar-expanded
'
);
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