github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/ui/app/helpers/lazy-click.js (about) 1 import Ember from 'ember'; 2 3 const { Helper, $ } = Ember; 4 5 /** 6 * Lazy Click Event 7 * 8 * Usage: {{lazy-click action}} 9 * 10 * Calls the provided action only if the target isn't an anchor 11 * that should be handled instead. 12 */ 13 export function lazyClick([onClick, event]) { 14 if (!$(event.target).is('a')) { 15 onClick(event); 16 } 17 } 18 19 export default Helper.helper(lazyClick);