Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

popover should close on clicking somewhere else #1521

Merged
merged 1 commit into from
Jun 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

## 0.5.2 - unreleased

### Fixed
- Close popover on clicking somewhere else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome :-)

[#1521](https:/owncloud/mail/pull/1521) @tahaalibra

## 0.5.1 – 2016-05-30

### Fixed
Expand Down
19 changes: 11 additions & 8 deletions js/views/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ define(function(require) {
toggleCollapse: function() {
this.collapsed = !this.collapsed;
this.render();
this.listenTo(Radio.ui, 'document:click', function(event) {
var target = $(event.target);
if (!this.$el.is(target.closest('.navigation-account'))) {
// Click was not triggered by this element -> close menu
this.menuShown = false;
this.toggleMenuClass();
}
});
},
toggleMenu: function(e) {
e.preventDefault();
Expand Down Expand Up @@ -104,6 +96,17 @@ define(function(require) {
OC.Notification.show(t('mail', 'Error while deleting account.'));
}
});
},
onShow: function() {
this.listenTo(Radio.ui, 'document:click', function(event) {
var target = $(event.target);
if (!this.$el.is(target.closest('.navigation-account'))) {
// Click was not triggered by this element -> close menu
this.menuShown = false;
this.toggleMenuClass();
}
});
}

});
});