mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
* Volumes and plugins navigation fixes, generally * Mirage no longer has to take the csi/ string into account * Volume adapter test fix
23 lines
478 B
JavaScript
23 lines
478 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
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 (!['a', 'button'].includes(event?.target?.tagName.toLowerCase())) {
|
|
onClick(event);
|
|
}
|
|
}
|
|
|
|
export default Helper.helper(lazyClick);
|