Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't close contextualdata if the user click the popup itself #5557

Merged
merged 1 commit into from
Feb 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions contribs/gmf/src/contextualdata/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,15 @@ export function ContextualdataController($compile, $timeout, $scope, gmfRaster,
this.gmfContextualdataOptions_ = $injector.has('gmfContextualdataOptions') ?
$injector.get('gmfContextualdataOptions') : {};

document.body.addEventListener('mousedown', () => {
this.$scope_.$apply(() => {
this.hidePopover();
});
document.body.addEventListener('mousedown', event => {
const element = this.overlay_.getElement();
const target = /** @type {Node} */ (event.target);
// don't close if the user click the popup itself. this allows the text to be copied.
if (!element.contains(target)) {
this.$scope_.$apply(() => {
this.hidePopover();
});
}
});
}

Expand Down