summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/right_sidebar.js
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-10-05 08:49:40 +0100
committerPhil Hughes <me@iamphill.com>2016-10-07 09:14:33 +0100
commit6cece3f49eb8777929b8a18a4fea1b8249bbb9df (patch)
tree31cf31939763d4458d1aed632e51f9fb7b913f76 /app/assets/javascripts/right_sidebar.js
parent7c59f45d10a791e790f55821ca501d9cdeddbabf (diff)
downloadgitlab-ce-6cece3f49eb8777929b8a18a4fea1b8249bbb9df.tar.gz
Show clicked issue data in the sidebar
Diffstat (limited to 'app/assets/javascripts/right_sidebar.js')
-rw-r--r--app/assets/javascripts/right_sidebar.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/assets/javascripts/right_sidebar.js b/app/assets/javascripts/right_sidebar.js
index e3d5f413c77..221460f32e7 100644
--- a/app/assets/javascripts/right_sidebar.js
+++ b/app/assets/javascripts/right_sidebar.js
@@ -5,15 +5,24 @@
function Sidebar(currentUser) {
this.toggleTodo = bind(this.toggleTodo, this);
this.sidebar = $('aside');
+ this.removeListeners();
this.addEventListeners();
}
+ Sidebar.prototype.removeListeners = function () {
+ this.sidebar.off('click', '.sidebar-collapsed-icon');
+ $('.dropdown').off('hidden.gl.dropdown');
+ $('.dropdown').off('loading.gl.dropdown');
+ $('.dropdown').off('loaded.gl.dropdown');
+ $(document).off('click', '.js-sidebar-toggle');
+ }
+
Sidebar.prototype.addEventListeners = function() {
this.sidebar.on('click', '.sidebar-collapsed-icon', this, this.sidebarCollapseClicked);
$('.dropdown').on('hidden.gl.dropdown', this, this.onSidebarDropdownHidden);
$('.dropdown').on('loading.gl.dropdown', this.sidebarDropdownLoading);
$('.dropdown').on('loaded.gl.dropdown', this.sidebarDropdownLoaded);
- $(document).off('click', '.js-sidebar-toggle').on('click', '.js-sidebar-toggle', function(e, triggered) {
+ $(document).on('click', '.js-sidebar-toggle', function(e, triggered) {
var $allGutterToggleIcons, $this, $thisIcon;
e.preventDefault();
$this = $(this);