mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
18 lines
378 B
JavaScript
18 lines
378 B
JavaScript
import Helper from '@ember/component/helper';
|
|
|
|
/**
|
|
* 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.tagName.toLowerCase() !== 'a') {
|
|
onClick(event);
|
|
}
|
|
}
|
|
|
|
export default Helper.helper(lazyClick);
|