mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Avoid side effects while clicking on a link in a card description
Fixes #261
This commit is contained in:
parent
39666d236a
commit
07e4637e3c
1 changed files with 17 additions and 0 deletions
|
|
@ -66,3 +66,20 @@ EscapeActions.register('textcomplete',
|
||||||
function() {},
|
function() {},
|
||||||
function() { return dropdownMenuIsOpened; }
|
function() { return dropdownMenuIsOpened; }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Template.viewer.events({
|
||||||
|
// Viewer sometimes have click-able wrapper around them (for instance to edit
|
||||||
|
// the corresponding text). Clicking a link shouldn't fire these actions, stop
|
||||||
|
// we stop these event at the viewer component level.
|
||||||
|
'click a': function(evt) {
|
||||||
|
evt.stopPropagation();
|
||||||
|
|
||||||
|
// XXX We hijack the build-in browser action because we currently don't have
|
||||||
|
// `_blank` attributes in viewer links, and the transformer function is
|
||||||
|
// handled by a third party package that we can't configure easily. Fix that
|
||||||
|
// by using directly `_blank` attribute in the rendered HTML.
|
||||||
|
evt.preventDefault();
|
||||||
|
let href = evt.currentTarget.href;
|
||||||
|
window.open(href, '_blank');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue