@zestia/ember-modal-dialog
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -29,6 +29,7 @@ import Component from '@ember/component'; | ||
constructor() { | ||
super(...arguments); | ||
init() { | ||
super.init(...arguments); | ||
this.rootElement = document.querySelector(':root'); | ||
this.documentElement = document.documentElement; | ||
this._load(); | ||
} | ||
@@ -67,3 +68,2 @@ | ||
this.rootElement.classList.add('has-modal'); | ||
this._load(); | ||
this._watchForContentChanges(); | ||
@@ -70,0 +70,0 @@ this._ready(); |
# Changelog | ||
## 1.0.4 | ||
- Move `@onLoad` action from did insert hook to component initialisation hook | ||
## 1.0.3 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "@zestia/ember-modal-dialog", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A simple modal dialog component for Ember apps", | ||
@@ -5,0 +5,0 @@ "directories": { |
@@ -51,3 +51,3 @@ # @zestia/ember-modal-dialog | ||
The modal dialog component isn't designed to be used on its own, but rather wrapped with a parent component... | ||
The modal dialog component isn't designed to be used on its own, but rather used to compose a new modal dialog component... in this example it's called "my-modal" | ||
@@ -57,5 +57,8 @@ ```javascript | ||
export default class MyModal extends Component { | ||
@tracked person; | ||
@tracked loadingError; | ||
@action | ||
loaded(person) { | ||
set(this, 'person', person); | ||
this.person = person; | ||
} | ||
@@ -65,3 +68,3 @@ | ||
failedToLoad(error) { | ||
set(this, 'loadingError', error.message); | ||
this.loadingError = error.message; | ||
} | ||
@@ -77,6 +80,8 @@ } | ||
@onLoaded={{this.loaded}} | ||
@onLoadError={{this.failedToLoad}} as |modal|> | ||
@onLoadError={{this.failedToLoad}} as |modal| | ||
> | ||
<modal.Header> | ||
Welcome | ||
</modal.Header> | ||
<modal.Content> | ||
@@ -91,4 +96,7 @@ {{#if modal.isLoading}} | ||
</modal.Content> | ||
<modal.Footer> | ||
<button {{on "click" modal.close}}>Close</button> | ||
<button {{on "click" modal.close}}> | ||
Close | ||
</button> | ||
</modal.Footer> | ||
@@ -113,4 +121,5 @@ </ModalDialog> | ||
@onClose={{this.hideMyModal}} | ||
@onFetchPerson={{fn this.loadPerson 123}} /> | ||
@onFetchPerson={{fn this.loadPerson 123}} | ||
/> | ||
{{/if}} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11505
120