Skip to content

Commit

Permalink
ember-event-helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeart committed Dec 9, 2023
1 parent 32443e6 commit eb4b19a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"ember-bootstrap": "^5.1.1",
"ember-cookies": "^1.0.0",
"ember-data": "5.1.1",
"ember-event-helpers": "^0.1.1",
"ember-intl": "^5.7.2",
"ember-modal-dialog": "^4.1.2",
"ember-modifier": "^4.0.0",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ yarn dev
1. `ember-ref-bucket`
1. `ember-modal-dialog`
1. `ember-responsive`
1. `ember-event-helpers`

[(see code for samples)](https://github.com/lifeart/demo-ember-vite/tree/master/src/addons)

Expand Down
9 changes: 9 additions & 0 deletions src/addons/ember-event-helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import PreventDefaultHelper from 'ember-event-helpers/addon/helpers/prevent-default.js';
import StopPropagationHelper from 'ember-event-helpers/addon/helpers/stop-propagation.js';

const registry = {
'helper:prevent-default': PreventDefaultHelper,
'helper:stop-propagation': StopPropagationHelper,
};

export default registry;
2 changes: 2 additions & 0 deletions src/addons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import EmberData from './ember-data';
import EmberNotify from './ember-notify';
import EmberModalDialog from './ember-modal-dialog';
import EmberResponsive from './ember-responsive';
import EmberEventHelpers from './ember-event-helpers';

const registry = {
...EmberSimpleAuthRegistry,
Expand All @@ -28,6 +29,7 @@ const registry = {
...EmberNotify,
...EmberModalDialog,
...EmberResponsive,
...EmberEventHelpers,
};

export default registry;
2 changes: 1 addition & 1 deletion src/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<EmberNotify />
{{#if this.showModal}}
<ModalDialog>
Ember Modal Dialog test <Button {{on 'click' this.closeModal}}>Close</Button>
Ember Modal Dialog test <Button {{on 'click' (stop-propagation this.closeModal)}}>Close</Button>
</ModalDialog>
{{/if}}

Expand Down
7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5690,6 +5690,13 @@ ember-element-helper@^0.6.0:
ember-cli-babel "^7.26.11"
ember-cli-htmlbars "^6.0.1"

ember-event-helpers@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/ember-event-helpers/-/ember-event-helpers-0.1.1.tgz#8df141306c927b9d1a7bc63d63095e92c0ba90a1"
integrity sha512-fWcbWd4W4nRv8bbato8JB6oGRpATkR+oGYxMIqnfgTgPWaCS0ww7CuUVNpwg1TulojKMCuTXi8Fem2b1NSF1ZQ==
dependencies:
ember-cli-babel "^7.19.0"

ember-focus-trap@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/ember-focus-trap/-/ember-focus-trap-1.0.1.tgz#a99565f6ce55d500b92a0965e79e3ad04219f157"
Expand Down

0 comments on commit eb4b19a

Please sign in to comment.