Skip to content

Commit

Permalink
Respect modifier keys when clicking on links
Browse files Browse the repository at this point in the history
  • Loading branch information
eviltrout committed Mar 24, 2017
1 parent 708efad commit 6875007
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -2,6 +2,7 @@ import DiscourseURL from 'discourse/lib/url';
import computed from 'ember-addons/ember-computed-decorators';
import { bufferedRender } from 'discourse-common/lib/buffered-render';
import { findRawTemplate } from 'discourse/lib/raw-templates';
import { wantsNewWindow } from 'discourse/lib/intercept-click';

export function showEntrance(e) {
let target = $(e.target);
Expand Down Expand Up @@ -122,6 +123,8 @@ export default Ember.Component.extend(bufferedRender({
}

if (target.hasClass('raw-topic-link')) {
if (wantsNewWindow(e)) { return true; }

this.appEvents.trigger('header:update-topic', topic);
DiscourseURL.routeTo(target.attr('href'));
return false;
Expand Down

1 comment on commit 6875007

@ZogStriP
Copy link
Member

Choose a reason for hiding this comment

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

👍

Please sign in to comment.