github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/helpers/lazy-click.js (about) 1 import Helper from '@ember/component/helper'; 2 3 /** 4 * Lazy Click Event 5 * 6 * Usage: {{lazy-click action}} 7 * 8 * Calls the provided action only if the target isn't an anchor 9 * that should be handled instead. 10 */ 11 export function lazyClick([onClick, event]) { 12 if (!['a', 'button'].includes(event.target.tagName.toLowerCase())) { 13 onClick(event); 14 } 15 } 16 17 export default Helper.helper(lazyClick);