Skip to content

Commit

Permalink
Bind fullscreen and clickOutsideToClose in paper-dialog-inner, rather…
Browse files Browse the repository at this point in the history
… than use nearestOfType to find the dialog component.
  • Loading branch information
DanChadwick committed Mar 21, 2016
1 parent c5480ba commit b59d2ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 4 additions & 8 deletions addon/components/paper-dialog-inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@ const { Component, computed } = Ember;
export default Component.extend(/*Translate3dMixin, TODO */ {
tagName: 'md-dialog',
classNames: ['md-default-theme' , 'md-transition-in' /* TODO */ ],
classNameBindings: ['contentOverflow:md-content-overflow', 'dialogComponent.fullscreen:md-dialog-fullscreen'],
classNameBindings: ['contentOverflow:md-content-overflow', 'fullscreen:md-dialog-fullscreen'],

dialogComponent: computed(function() {
return this.nearestOfType(PaperDialog);
}),
translateFromOrigin: computed.reads('openFrom'),

translateFromOrigin: computed.reads('dialogComponent.openFrom'),

translateToParent: computed.reads('dialogComponent.closeTo'),
translateToParent: computed.reads('closeTo'),

onTranslateDestroy(origin) {
origin.focus();
},

click(ev) {
if (this.get('dialogComponent.clickOutsideToClose')) {
if (this.get('clickOutsideToClose')) {
ev.stopPropagation();
return false;
}
Expand Down
8 changes: 7 additions & 1 deletion app/templates/components/paper-dialog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@
onTap=(action "outsideClicked")
}}
{{#paper-dialog-container outsideClicked=(action "outsideClicked")}}
{{#paper-dialog-inner parent=parent openFrom=openFrom closeTo=closeTo}}
{{#paper-dialog-inner
parent=parent
openFrom=openFrom
closeTo=closeTo
fullscreen=fullscreen
clickOutsideToClose=clickOutsideToClose
}}
{{yield}}
{{/paper-dialog-inner}}
{{/paper-dialog-container}}
Expand Down

0 comments on commit b59d2ab

Please sign in to comment.