-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Modal): use separate components for modal header and close butto…
…n to allow for better customization
- Loading branch information
1 parent
647e725
commit 7ba6bc1
Showing
7 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Ember from 'ember'; | ||
import layout from '../../../templates/components/bs-modal/header/close'; | ||
|
||
/** | ||
@class ModalHeaderClose | ||
@namespace Components | ||
@extends Ember.Component | ||
@private | ||
*/ | ||
export default Ember.Component.extend({ | ||
layout, | ||
tagName: 'button', | ||
classNames: ['close'], | ||
attributeBindings: ['type', 'aria-label'], | ||
'aria-label': 'Close', | ||
type: 'button', | ||
|
||
/** | ||
* @event onClick | ||
* @public | ||
*/ | ||
onChange() {}, | ||
|
||
click() { | ||
this.get('onClick')(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Ember from 'ember'; | ||
import layout from '../../../templates/components/bs-modal/header/title'; | ||
|
||
/** | ||
@class ModalHeaderTitle | ||
@namespace Components | ||
@extends Ember.Component | ||
@private | ||
*/ | ||
export default Ember.Component.extend({ | ||
layout, | ||
tagName: 'h4', | ||
classNames: ['modal-title'] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{{#if closeButton}} | ||
<button type="button" class="close" aria-label="Close" onclick={{onClose}}><span aria-hidden="true">×</span></button> | ||
{{bs-modal/header/close onClick=(action onClose)}} | ||
{{/if}} | ||
{{#if hasBlock}} | ||
{{yield}} | ||
{{else}} | ||
<h4 class="modal-title">{{title}}</h4> | ||
{{#bs-modal/header/title}}{{title}}{{/bs-modal/header/title}} | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span aria-hidden="true">×</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{yield}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-bootstrap/components/bs-modal/header/close'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'ember-bootstrap/components/bs-modal/header/title'; |