Skip to content

Commit

Permalink
feat(MdDatepicker): add close and open events (#1577)
Browse files Browse the repository at this point in the history
* feat(MdDatepicker): add close, open events

* docs(MdDatepicker): close, open events
  • Loading branch information
Samuell1 authored and marcosmoura committed Mar 7, 2018
1 parent dc7892e commit 5cb9b7b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/app/pages/Components/Datepicker/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<p>All the following options can be applied to the md-datepicker component:</p>

<api-table :headings="props.headings" :props="props.props" slot="props" />
<api-table :headings="events.headings" :props="events.props" slot="events" />
</api-item>
</div>
</page-container>
Expand Down Expand Up @@ -72,6 +73,21 @@
defaults: 'true'
}
]
},
events: {
headings: ['Name', 'Description', 'Value'],
props: [
{
name: 'md-opened',
description: 'Triggered when a datepicker dialog opens',
value: 'null'
},
{
name: 'md-closed',
description: 'Triggered when a datepicker dialog closes',
value: 'null'
},
]
}
})
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/MdDatepicker/MdDatepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
toggleDialog () {
if (!isFirefox || this.mdOverrideNative) {
this.showDialog = !this.showDialog
if (this.showDialog) {
this.$emit('md-opened')
} else {
this.$emit('md-closed')
}
} else {
this.$refs.input.$el.click()
}
Expand Down

0 comments on commit 5cb9b7b

Please sign in to comment.