491f4ff27d
Click events were greedily redirecting to the resource pages instead of first yielding to the anchor tag clicked if an anchor tag was in fact clicked.
20 lines
371 B
JavaScript
20 lines
371 B
JavaScript
import Ember from 'ember';
|
|
|
|
const { Helper, $ } = Ember;
|
|
|
|
/**
|
|
* Lazy Click Event
|
|
*
|
|
* Usage: {{lazy-click action}}
|
|
*
|
|
* Calls the provided action only if the target isn't an anchor
|
|
* that should be handled instead.
|
|
*/
|
|
export function lazyClick([onClick, event]) {
|
|
if (!$(event.target).is('a')) {
|
|
onClick(event);
|
|
}
|
|
}
|
|
|
|
export default Helper.helper(lazyClick);
|